Codex Manual

Use XSI Router

XSI Router is useful when you want centralized API, account, quota, and model governance for Codex.

~/.codex/config.toml:

model_provider = "xai"
model = "gpt-5.6-sol"
approval_policy = "on-request"
sandbox_mode = "workspace-write"

[model_providers.xai]
name = "xai"
base_url = "https://api.xsirouter.com"
wire_api = "responses"
requires_openai_auth = false
env_key = "XAI_API_KEY"
supports_websockets = false

Start:

export XAI_API_KEY="sk-Xvs..."
codex

PowerShell:

$env:XAI_API_KEY="sk-Xvs..."
codex

Switch models

To switch models, change model, or start with codex --model <model-id>. See the models page for available model IDs.

HTTP and WebSocket

Current Codex custom providers use wire_api = "responses". The configuration above explicitly uses HTTP. To enable Responses WebSocket, change only:

supports_websockets = true

Continue with the GPT Image 2.5 Images API guide or see Codex CLI / App API key integration.