Responses API profile
Codex profiles can use wire_api = "responses", base_url = "https://api.sagerouter.dev/v1/", and model = "sage-router/frontier" for hosted routing.
Codex CLI routing
Use Sage Router as the model-routing layer behind Codex CLI. Keep the OpenAI-compatible Responses wire format, point Codex at hosted Sage Router or local port 8790, and let route policy handle failover, capability matching, and provider custody.
Codex profiles can use wire_api = "responses", base_url = "https://api.sagerouter.dev/v1/", and model = "sage-router/frontier" for hosted routing.
Run Sage Router on http://127.0.0.1:8790/v1/ or a Tailnet host when provider credentials, OAuth profiles, and local Ollama fallback should stay on trusted infrastructure.
When a Codex route, provider key, or upstream model rate-limits, Sage Router can choose another eligible route instead of forcing every Codex profile to encode fallback logic.
# ~/.codex/config.toml [model_providers.sage-router-hosted] name = "Sage Router hosted" base_url = "https://api.sagerouter.dev/v1/" env_key = "SAGE_ROUTER_API_KEY" wire_api = "responses" [profiles.sage-router] model_provider = "sage-router-hosted" model = "sage-router/frontier" # Shell export SAGE_ROUTER_API_KEY=sk_sage_your_generated_key codex --profile sage-router
Agentic and frontier profiles keep coding-agent behavior strict while allowing eligible providers to compete on health, latency, capability, and policy.
Use the same router with OpenClaw, local workspaces, Umbrel hosts, and Tailnet machines so Codex routing stays consistent across the fleet.
Sage Router does not implement its own auth.openai.com/codex/device OAuth route or grant unauthorized OpenAI/Codex access. Bring authorized provider access or use hosted routing for Sage Router account control.
Codex CLI is most useful when the model layer can adapt to the task. Sage Router keeps Codex pointed at one endpoint while routing by policy, capability, provider health, local availability, and quota state behind the scenes.
Create an API key, open the Codex guide, copy the hosted quickstart, or estimate routing fit.