Skip to content

Codex CLI ​

Codex CLI speaks OpenAI Responses. Add LeekBox as a provider in config.toml.

Set it up from a GUI instead

Prefer not to edit config files: use CC-Switch (Claude Code / Codex) or Magpie (one place for every agent).

Install ​

bash
npm install -g @openai/codex

Configure ​

Edit ~/.codex/config.toml:

toml
model = "gpt-6.1-sol"
model_provider = "leekbox"

[model_providers.leekbox]
name = "LeekBox"
base_url = "https://leekbox.ai/v1"
env_key = "LEEKBOX_API_KEY"
wire_api = "responses"
bash
export LEEKBOX_API_KEY="sk-..."
codex

Which models ​

gpt-6-astra, gpt-6.1-sol, gpt-6.2-astra, gpt-6.2-sol are the current flagships; gpt-5.6-sol stays available for existing scripts. Responses-only features (native compaction, responses compact) work fully.

Switching back ​

Remove model_provider (or comment out the provider block), then codex login.

Troubleshooting ​

SymptomFix
404 modelNot in this group
400 unexpected wire_apiMust be responses; chat routes to the wrong protocol
Reconnect loopbase_url must include /v1 here

LeekBox — unified AI gateway