Codex CLI
Settings for using Echo Token Station models from OpenAI's Codex CLI. Codex CLI connects through the Responses API.
Codex CLI is OpenAI's AI coding tool. It runs in the terminal. Codex CLI connects to Echo using only the Responses API (/v1/responses).
Tested: Codex CLI 0.157.1 (2026-09-27, Echo's test environment)
Before you start
- Have your Echo API key and the ID of the model you want to use ready. You can find model IDs in the model list
- Codex CLI is a tool for OpenAI models. We have not tested how it behaves with models other than OpenAI's
Set up
- Put your Echo API key in the environment variable
ECHO_API_KEY
export ECHO_API_KEY="sk-..."- Write the following in the Codex CLI settings file
~/.codex/config.toml. If you set the environment variableCODEX_HOME, useconfig.tomlin that folder
model = "gpt-6-sol"
model_provider = "echo"
[model_providers.echo]
name = "Echo Token Station"
base_url = "https://token.echohub.io/v1"
env_key = "ECHO_API_KEY"
wire_api = "responses"| Item | Meaning |
|---|---|
model | The ID of the model to use |
model_provider | The name of the provider settings to use. Make it the same as echo in [model_providers.echo] below |
name | The name shown on screen |
base_url | The base URL. Include /v1 |
env_key | The name of the environment variable to read the API key from |
wire_api | The protocol. Set it to "responses" |
If you set wire_api to "chat", Codex CLI 0.157.1 stops at startup with the error wire_api = "chat" is no longer supported.
Check that it works
- In a terminal where
ECHO_API_KEYis set, go to your working folder and run the following command. To try it in a folder that is not a Git repository, add--skip-git-repo-check
codex exec "Reply with the single word hi."- If an answer is shown, you are done. The call also appears in 「呼び出し履歴」 (Call history) in the console
If you specify a model ID that Codex CLI does not know, the warning Model metadata for ... not found appears. The call continues anyway.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
wire_api = "chat" is no longer supported at startup | wire_api is "chat" | Set wire_api = "responses" |
| 404 with an HTML page instead of JSON | base_url does not end with /v1 | Change it to https://token.echohub.io/v1 |
401 and Invalid API key | The key is wrong, stopped or expired, or has used up its spending limit | Check the key's status in the console |
404 and Invalid URL (POST /v1/v1/responses) | base_url has /v1 twice | Change it to https://token.echohub.io/v1 |
403 and Insufficient balance | Insufficient balance | Top up |
503 and The model … does not exist or is not available | The model ID is wrong, or Echo does not offer the model | Check the model ID in model |
The list of error bodies is in Errors and fixes.
Codex CLI sends requests with store: false (telling the upstream API not to store the answer). Echo passes this value to the upstream unchanged.
Sources
| What | Source | Checked |
|---|---|---|
Connecting with the config.toml settings, the wire_api = "chat" error, the warning for unknown model IDs, sending store: false | Measured in Echo's test environment (Codex CLI 0.157.1), with the same relay settings as production and a server that returns test responses in place of the upstream API | 2026-09-27 |
model_provider and the items of [model_providers.<id>] (name, base_url, env_key, wire_api), CODEX_HOME | https://developers.openai.com/codex/config-advanced | 2026-09-27 |
wire_api = "chat" was removed | https://github.com/openai/codex/discussions/7782 | 2026-09-27 |