Codex
Integration status
- Recommended protocol: OpenAI Responses
- Configuration checked: July 15, 2026 (official Codex configuration reference)
- Runtime verification: Pending
Codex custom providers use the Responses protocol. Select a GetRouter model that supports /v1/responses.
Store the API key
Add it to your shell's secure environment configuration if needed. Do not write the key directly into config.toml.
Configure Codex
Edit ~/.codex/config.toml:
Replace MODEL_ID with an exact model ID from Models. Preserve unrelated Codex settings.
Warning
Do not use wire_api = "chat". Current Codex custom providers use Responses. A model that only supports Chat Completions is not suitable for this configuration.
Verify
- Restart Codex from a shell where
GETROUTER_API_KEYis set. - Confirm Codex shows the expected model/provider.
- Start with a harmless repository question.
- Confirm the request appears in GetRouter usage logs.
- Only then test edits, tool calls, long context, or higher reasoning settings.
Common errors
- Missing environment variable: launch Codex from a shell that exports
GETROUTER_API_KEY. - 404 on
/responses: usebase_url = "https://getrouter.ai/v1"; do not append/responsesyourself. - Model not found: copy the exact model ID and confirm the key can use it.
- Unsupported response or tool event: the selected model/provider path may not fully support Responses tool events; test another Responses-capable model.
- Codex still uses another provider: check the active config profile and top-level
model_provider.
See Integration troubleshooting before sharing diagnostics.
