Codex CLI
Connect OpenAI Codex CLI to APIClaw using an OpenAI-compatible provider block.
Codex CLI can call models through APIClaw's OpenAI-compatible API. Create an API key first, then add a custom provider to ~/.codex/config.toml.
Install Codex CLI
Codex requires Node.js. Verify your environment:
bash
node --version
npm --version
npm install -g @openai/codexConfigure APIClaw
Export your API key:
bash
export APICLAW_API_KEY="sk-your-apiclaw-key"Add this provider to ~/.codex/config.toml:
toml
model_provider = "apiclaw"
model = "YOUR_MODEL_ID"
model_reasoning_effort = "high"
[model_providers.apiclaw]
name = "APIClaw"
base_url = "https://apiclaw.biz/v1"
env_key = "APICLAW_API_KEY"
wire_api = "responses"| Setting | Value |
|---|---|
| base_url | https://apiclaw.biz/v1 |
| model | Full model ID from the model hub |
| wire_api | responses for current Codex releases |
For legacy Codex 0.80.0 only, use wire_api = "chat".
Verify
bash
cd /path/to/your/project
codexIf Codex opens and responds, the configuration is working.
Troubleshooting
wire_api = chat is no longer supported
Upgrade Codex or set wire_api = "responses".
401 Unauthorized
Confirm APICLAW_API_KEY is exported in the same terminal session and matches env_key.
404 Not Found
Confirm base_url includes /v1 and the model ID exists in your model hub.