1. Install the Codex CLI
Install globally with npm (Codex CLI is npm-only). Requires Node.js 18+.
npm install -g @openai/codexcodex --versionCodex CLI
Point the OpenAI Codex CLI at Zion Router to run agentic coding tasks through our ChatGPT subscription pool.
Install globally with npm (Codex CLI is npm-only). Requires Node.js 18+.
npm install -g @openai/codexcodex --versionCreate ~/.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
# ~/.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
# ~/.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.
One block that writes both files and creates ~/.codex if missing. Pick your OS.
macOS / Linux (bash, zsh)
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-..."
}
EOFWindows (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 UTF8Set any of these codes as the top-level model in config.toml, or override per-invocation with --model.
| Model | Description |
|---|---|
| gpt-5.5 | Most capable |
| gpt-5.4 | Fast, balanced |
| gpt-5.4-mini | Lightweight |
| gpt-5.3-codex | Coding-focused |
| gpt-5.2 | Efficient |
Run codex with a natural-language instruction. It reads your project files and applies changes interactively.
codex "refactor this file to use async/await"cat main.py | codex "add type hints to all functions"codex --full-auto "add input validation to exported functions"Top up any amount to start. No credit card required.