~/.codex/config.toml. Requests appear in Traces automatically.
Prerequisites
- Codex CLI installed
- Active Orq.ai account with AI Gateway access
- Orq.ai API key
- Model enabled in AI Gateway → Supported Models
Setup
Export the API key
~/.zshrc or ~/.bashrc.Create or edit ~/.codex/config.toml
Create Replace
~/.codex/config.toml if it does not exist. Add or merge the following keys. The top-level model and model_provider lines set the default; the [model_providers.orq] block registers the custom provider:openai/gpt-5.4 with the provider-prefixed model to use by default (e.g. anthropic/claude-sonnet-4-6). If a model key already exists in the file, replace it.Configuration reference
| Field | Value | Description |
|---|---|---|
model | provider/model-id | Default model. Must use provider-prefixed format. |
model_provider | orq | Selects the custom provider defined below. |
base_url | https://api.orq.ai/v3/router | AI Gateway router endpoint. |
env_key | ORQ_API_KEY | Environment variable that holds the API key. |
wire_api | responses | Wire protocol. Codex uses the Responses API. |
requires_openai_auth | false | Disables the OpenAI auth header. Required for Orq-routed calls. |
Troubleshooting
Authentication error
Authentication error
Confirm
ORQ_API_KEY is exported in the shell running Codex. Run echo $ORQ_API_KEY to verify the value is set.Model not found
Model not found
The model must be enabled in AI Gateway → Supported Models before Codex can route to it. Check that the model ID in
config.toml uses the provider-prefixed format (e.g. openai/gpt-5.4, not gpt-4o).No traces appearing in Orq.ai
No traces appearing in Orq.ai
Confirm
base_url is https://api.orq.ai/v3/router and model_provider is set to the custom provider name (e.g. orq), not openai.Verification
Send a prompt in Codex. The response appears in the terminal and the trace appears in Orq.ai Traces with the model identifier (e.g.openai/gpt-5.4).