Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.routing.run/llms.txt

Use this file to discover all available pages before exploring further.

OpenAI’s Codex CLI uses the standard OpenAI client env vars. Set OPENAI_BASE_URL to routing.run and pass --model route/… so each run targets a model your key can access. Official references:

Setup

1

Get your API key

Create an API key at app.routing.run. Copy the key — it starts with rk_.
2

Set environment variables

Copy the Connection prompt below and apply the export lines before running codex.
3

Run Codex

Use any routing.run model with the Codex CLI.

Connection prompt

Codex CLI uses OpenAI-compatible env vars (OPENAI_API_KEY, OPENAI_BASE_URL). Use Copy on the block below when you want a complete, step-by-step setup checklist.

Codex CLI — connect to routing.run

Manual configuration

If you want to set Codex CLI up manually instead of using the prompt above, use these exact values:
export ROUTING_RUN_API_KEY='rk_REPLACE_ME'
export OPENAI_API_KEY="$ROUTING_RUN_API_KEY"
export OPENAI_BASE_URL="https://api.routing.run/v1"
If you keep multiple CLI backends locally, save these exports in a small shell wrapper or env file named routing.run so you can switch providers quickly. Codex also supports explicit provider definitions in ~/.codex/config.toml. This is the most reliable long-term setup for routing.run:
model = "route/glm-5.1"
model_provider = "routingrun"

[model_providers.routingrun]
base_url = "https://api.routing.run/v1"
env_key = "ROUTING_RUN_API_KEY"
Example run:
codex --model route/glm-5.1 "Summarize this repo"

Usage

codex --model route/glm-5.1 "Your prompt here"
Prefer the TOML provider config over ad hoc shell exports if you use Codex regularly across multiple repos.
Published model IDs are listed on the models page. Exact access depends on your plan tier and the dashboard; common picks:
ModelUse case
route/glm-5.1-precisionStrongest reasoning-first choice
route/qwen3.6-plusBest default starting point
route/minimax-m2.7-highspeedLong-context sessions
route/kimi-k2.5Agentic and tool-heavy flows
route/glm-5.1Faster GLM alternative
route/qwen3.5-plusQwen3.5 flagship