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/codex

Configure 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"
SettingValue
base_urlhttps://apiclaw.biz/v1
modelFull model ID from the model hub
wire_apiresponses for current Codex releases

For legacy Codex 0.80.0 only, use wire_api = "chat".

Verify

bash
cd /path/to/your/project
codex

If 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.