Codex

Codex

Configure LivRouter as a custom Responses provider in a Codex client that supports custom providers. Choose a model whose LivRouter route supports Responses and the tool capabilities your task needs.

Prepare the client and key

Install Codex CLI using the official package, or open your existing installation. Check the client version before applying configuration.

bash
npm install -g @openai/codexcodex --versionexport LIVROUTER_API_KEY="your-livrouter-api-key"
powershell
$env:LIVROUTER_API_KEY = "your-livrouter-api-key"

The key must be available to the process launching Codex. A desktop app launched separately may not inherit variables from your terminal; use a supported environment configuration for that client.

Configure the provider

Merge the following into ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml). Replace the model placeholder with an exact compatible ID from your catalog. Preserve your other settings.

toml
model = "YOUR_RESPONSES_MODEL_ID"model_provider = "livrouter" [model_providers.livrouter]name = "LivRouter"base_url = "https://api.livrouter.com/v1"env_key = "LIVROUTER_API_KEY"wire_api = "responses"requires_openai_auth = falsesupports_websockets = false
Keep the provider separate. The livrouter provider reads its key from LIVROUTER_API_KEY. You do not need to overwrite an existing OpenAI login file. This example uses HTTP Responses; it does not establish support for WebSocket transport or remote compaction.

Verify the setup

  1. Start a new Codex session from the terminal with the key configured.
  2. Confirm the selected provider and model, then send a short prompt.
  3. Find the matching request in Usage logs.
  4. Test a small tool task before using a long agent workflow.

Troubleshooting

  • Missing environment variable: set the key in the environment that launches this client.
  • 401: verify the LivRouter key and the provider's env_key name.
  • 404 or unsupported model: check the exact model ID, the /v1 suffix, and Responses compatibility.
  • Old provider still active: inspect the session selection and create a new session after changing the configuration.
  • Tool or compaction failure: verify that capability separately; do not infer support from a successful text response.

Configuration fields were checked against the official Codex configuration schema. For protocol details, see Responses.