Codex CLI

Use Codex CLI with Zion Router

Point the OpenAI Codex CLI at Zion Router to run agentic coding tasks through our ChatGPT subscription pool.

1. Install the Codex CLI

Install globally with npm (Codex CLI is npm-only). Requires Node.js 18+.

npm
npm install -g @openai/codex
verify
codex --version

2. Configure your API key

Create ~/.codex/config.toml to register Zion Router as a model provider, and ~/.codex/auth.json with your zr- key. The newer Codex CLI no longer reads OPENAI_BASE_URL — use the model_providers block instead.

Sign up to get an API key and prefill the snippets below. Sign up free

~/.codex/config.toml

toml
# ~/.codex/config.toml
model = "gpt-5.4"
model_provider = "ZionRouter"

[model_providers.ZionRouter]
name = "Zion Router"
base_url = "https://api.zionrouter.com/v1"
wire_api = "responses"

~/.codex/auth.json

json
# ~/.codex/auth.json
{
  "auth_mode": "apikey",
  "OPENAI_API_KEY": "zr-..."
}

Optional knobs: set model_reasoning_effort = "high" to bias toward longer reasoning, or sandbox_mode to control file-write permissions. See the upstream Codex CLI README for the full list.

3. Quick setup (copy-paste)

One block that writes both files and creates ~/.codex if missing. Pick your OS.

macOS / Linux (bash, zsh)

bash
mkdir -p ~/.codex
cat > ~/.codex/config.toml << 'EOF'
model = "gpt-5.4"
model_provider = "ZionRouter"

[model_providers.ZionRouter]
name = "Zion Router"
base_url = "https://api.zionrouter.com/v1"
wire_api = "responses"
EOF
cat > ~/.codex/auth.json << 'EOF'
{
  "auth_mode": "apikey",
  "OPENAI_API_KEY": "zr-..."
}
EOF

Windows (PowerShell)

powershell
New-Item -ItemType Directory -Force -Path "$HOME\.codex" | Out-Null
@'
model = "gpt-5.4"
model_provider = "ZionRouter"

[model_providers.ZionRouter]
name = "Zion Router"
base_url = "https://api.zionrouter.com/v1"
wire_api = "responses"
'@ | Set-Content -Path "$HOME\.codex\config.toml" -Encoding UTF8

@'
{
  "auth_mode": "apikey",
  "OPENAI_API_KEY": "zr-..."
}
'@ | Set-Content -Path "$HOME\.codex\auth.json" -Encoding UTF8

4. Available models

Set any of these codes as the top-level model in config.toml, or override per-invocation with --model.

ModelDescription
gpt-5.5Most capable
gpt-5.4Fast, balanced
gpt-5.4-miniLightweight
gpt-5.3-codexCoding-focused
gpt-5.2Efficient

5. Run your first task

Run codex with a natural-language instruction. It reads your project files and applies changes interactively.

interactive
codex "refactor this file to use async/await"
pipe stdin
cat main.py | codex "add type hints to all functions"
full project
codex --full-auto "add input validation to exported functions"

Start routing in 60 seconds.

Top up any amount to start. No credit card required.

Pay-as-you-goNo card requiredDaily Access from $0/mo