Guides
Codex CLI
Run OpenAI's Codex CLI on AZRouter models through the Responses endpoint.
Tested: Codex CLI 0.162.1, 2026-10-16
Codex CLI talks to /v1/responses. Add AZRouter as a model provider in Codex's config file and export your key.
1. Install
npm install -g @openai/codex2. Add AZRouter to ~/.codex/config.toml
model = "qwen/qwen3.8-flash"
model_provider = "azrouter"
web_search = "disabled"
[model_providers.azrouter]
name = "AZRouter"
base_url = "https://api.azrouter.dev/v1"
env_key = "AZROUTER_API_KEY"
wire_api = "responses"
[features]
multi_agent = falseTwo lines are required, not optional:
web_search = "disabled": Codex otherwise sends its built-in web search tool, which AZRouter refuses with 400unsupported_paid_feature.multi_agent = false: the multi-agent feature sends a tool type AZRouter doesn't accept, with the same 400.
env_key names the environment variable Codex reads the key from.
3. Check it
codex exec "Reply with exactly: Hello from AZRouter"Run it inside a Git repository, or add --skip-git-repo-check. Then start codex in your project as usual.
What to expect
- Model metadata warning. Codex prints "Model metadata for
qwen/qwen3.8-flashnot found. Defaulting to fallback metadata". Requests still work. - Cost per prompt. Every prompt carries Codex's instructions and tool definitions. On
qwen/qwen3.8-flashthe one-line check above used 6,546 tokens and cost $0.0011 the first time; a repeat run 16 minutes later cost $0.00015, when the provider had cached most of the prompt.