DocsTool guidesCodex
Codex
OpenAI’s coding agent for the terminal. It uses the Responses API: add ACCTOKEN as a provider in ~/.codex/config.toml with the /v1 base URL.
Root URLhttps://intl.acctoken.com+ /v1https://intl.acctoken.com/v1Full paththe whole endpoint, e.g. https://intl.acctoken.com/v1/chat/completions
Before you start
- An ACCTOKEN API key. Create one on API Keys in the console.
- Codex CLI installed. Run
codex --versionto check.
01Connection details
- Format
- Responses API
- Base URL
https://intl.acctoken.com/v1+ /v1- API key
YOUR_API_KEYin theACCTOKEN_API_KEYvariable- Model
gpt-6.1-sola GPT model- Set in
~/.codex/config.toml
02Set it up
Add a provider to ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml). Keep model and model_provider above the first [table]. If you have set CODEX_HOME, the file is $CODEX_HOME/config.toml instead.
wire_api = "responses" is the only value current Codex accepts. base_url ends in /v1; Codex adds /responses.The key lives in the environment variable named by env_key. Set it once:
~/.zshrc or ~/.bashrc.03Check it works
Run one task without opening the interactive view:
OKInside an interactive session, /status shows the model and provider in use.
Common problems
No available channel for model … (distributor)
Codex asked for a model ID that is not on the Models page, often its built-in default. Set model in config.toml to one of the IDs listed in the error.
Some models fail in Codex
Codex only uses the Responses API. Claude and Gemini models do not support it. Pick a model from the table in Model IDs.
Missing environment variable: `ACCTOKEN_API_KEY`
The variable is not set where Codex started. Set it as above, then open a new terminal, or quit and reopen the desktop app.
Invalid token
The variable holds an old or incomplete key. Copy the key again from API Keys.
Incorrect API key provided … url: https://api.openai.com/v1/responses
Codex is still calling OpenAI, so it did not pick up the provider. Check that model_provider = "acctoken" sits above the first [table] and, if CODEX_HOME is set, that you edited $CODEX_HOME/config.toml.
wire_api = "chat" stopped working
Current Codex only supports the Responses API. Set wire_api = "responses" or remove the line.
It works in the terminal but not in the desktop app
Apps opened from the desktop do not see variables exported in a terminal. Use the permanent setting above, then quit and reopen the app.
Something else? Look up the exact message in Errors.