Tool Setup
Configure Codex CLI
Install Codex CLI, run the setup script, or write config.toml and auth.json manually.
Last updated 2026-05-12 | Maintained by TokenPool documentation team
Codex CLI is OpenAI's command-line coding tool. TokenPool supports Codex CLI through a TokenPool API Key, an OpenAI-compatible base_url, and the Responses API wire format.
Install Codex CLI
npm install -g @openai/codex
Verify:
codex --version
Automatic setup
macOS / Linux:
TOKENPOOL_API_KEY="<your TokenPool API Key>" \
TOKENPOOL_BASE_URL="https://api.clawto.link" \
bash -c "$(curl -fsSL 'https://cdn.tokenpool.dev/scripts/codex-install-config.sh')"
Windows PowerShell:
$env:TOKENPOOL_API_KEY='<your TokenPool API Key>'; $env:TOKENPOOL_BASE_URL='https://api.clawto.link'; irm 'https://cdn.tokenpool.dev/scripts/codex-install-config.ps1' | iex
Manual setup
Create ~/.codex/config.toml:
model_provider = "OpenAI"
model = "gpt-5.5"
review_model = "gpt-5.5"
model_reasoning_effort = "xhigh"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
model_context_window = 1000000
model_auto_compact_token_limit = 900000
[model_providers.OpenAI]
name = "OpenAI"
base_url = "https://api.clawto.link"
wire_api = "responses"
requires_openai_auth = true
Create ~/.codex/auth.json:
{
"OPENAI_API_KEY": "<your TokenPool API Key>"
}
Verify
codex "Reply with one sentence if this configuration works"
If the command succeeds, Codex CLI is using TokenPool for the request.
Common errors
| Symptom | Check |
|---|---|
| Unauthorized request | API Key in auth.json may be missing or incomplete |
| Connection failed | base_url may point to the website instead of the API endpoint |
| Model not found | Local model catalog may need the GPT-5.5 fix command |
| Quota exhausted | Check balance and usage in the TokenPool console |
Related docs
FAQ
Can Codex CLI use a TokenPool API Key?
Yes. Put the TokenPool API Key in ~/.codex/auth.json and configure the TokenPool endpoint in ~/.codex/config.toml.
Which base_url should I use for Codex CLI?
Start with https://api.clawto.link. If your network is more stable with the standard endpoint, use https://api.tokenpool.dev.
Should I store the API Key in config.toml?
No. Keep the API Key in auth.json or an environment variable. Do not commit secrets to Git.