BLACK FRIDAYUntil Dec 8 (Tue) 23:59 JSTUntil Dec 8

DocsCodex CLI

Codex CLI settings (config.toml, Responses API)

How to write config.toml to use 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

  1. Put your Echo API key in the environment variable ECHO_API_KEY
bash
export ECHO_API_KEY="sk-..."
  1. Write the following in the Codex CLI settings file ~/.codex/config.toml. If you set the environment variable CODEX_HOME, use config.toml in that folder
toml
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"
ItemMeaning
modelThe ID of the model to use
model_providerThe name of the provider settings to use. Make it the same as echo in [model_providers.echo] below
nameThe name shown on screen
base_urlThe base URL. Include /v1
env_keyThe name of the environment variable to read the API key from
wire_apiThe 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

  1. In a terminal where ECHO_API_KEY is 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
bash
codex exec "Reply with the single word hi."
  1. 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

SymptomCauseFix
wire_api = "chat" is no longer supported at startupwire_api is "chat"Set wire_api = "responses"
404 with an HTML page instead of JSONbase_url does not end with /v1Change it to https://token.echohub.io/v1
401 and Invalid API keyThe key is wrong, stopped or expired, or has used up its spending limitCheck the key's status in the console
404 and Invalid URL (POST /v1/v1/responses)base_url has /v1 twiceChange it to https://token.echohub.io/v1
403 and Insufficient balanceInsufficient balanceTop up
503 and The model … does not exist or is temporarily unavailableThe model ID is wrong, or Echo does not offer the modelCheck 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.