Skip to content

Codex CLI

Codex connects to indoRouter through /v1/responses. Use the ID of any chat model in the catalog.

Create an API key on the API Key page before you start.

Store the key:

Terminal window
export INDOROUTER_API_KEY="ir_..."

Add this to ~/.codex/config.toml. The first two lines go above any [table] in the file:

model_provider = "indorouter"
model = "openai/gpt-4o-mini"
[model_providers.indorouter]
name = "indoRouter"
base_url = "https://api.indorouter.ai/v1"
env_key = "INDOROUTER_API_KEY"
wire_api = "responses"

Switch models with /model, or start Codex on another model with codex -m <id>. Model IDs are on the Models page.

Run codex and ask it something short. The request appears on the console’s Requests page.

  • 404: base_url has to end in /v1.
  • model_not_found: the model ID needs its vendor, as in openai/gpt-4o-mini.
  • responses_untranslatable: for models outside OpenAI, indoRouter translates Responses requests into the vendor’s format, and a few Responses features have no equivalent there. The error message names what couldn’t be translated. See Responses.