Connect Codex CLI / Codex App to CCX
If you are using CCX Desktop, you can apply Codex settings from Agent configuration first, then return here to confirm the Responses endpoint and Base URL behavior.
Codex CLI and Codex App use the same OpenAI-compatible configuration: Base URL, API key, and model name are the same. Only the configuration entry point differs.
How it works
Codex CLI / App -> CCX /v1/responses -> Responses channel -> upstream Responses or Chat endpoint1. Configure a CCX channel
- Open the CCX admin console and go to Responses
- Click "Add Channel"
- Choose the service type based on upstream capability
| Upstream capability | Service type | Notes |
|---|---|---|
| Native OpenAI Responses | Responses | Direct Responses forwarding |
| OpenAI Chat-compatible | OpenAI Chat | CCX converts Responses to Chat Completions |
| Claude | Claude | CCX converts Responses to Claude Messages |
If the upstream is Chat-compatible and does not support non-standard Chat roles such as developer, edit the channel and enable Normalize Non-standard Chat Roles.
2. Shared configuration values
Codex CLI and Codex App both use these values:
| Setting | Value |
|---|---|
| API Key | your-ccx-proxy-key |
| Base URL | http://localhost:3000/v1 |
| Model | requested model name, for example gpt-5 |
TIP
The API key here is CCX PROXY_ACCESS_KEY, not the upstream provider API key. Upstream keys are configured only in CCX channels.
3. Codex CLI configuration
Set these environment variables:
export OPENAI_API_KEY="your-ccx-proxy-key"
export OPENAI_BASE_URL="http://localhost:3000/v1"Then run:
codex "hello"If your Codex CLI version uses a config file instead of environment variables, fill in the same values:
API Key: your-ccx-proxy-key
Base URL: http://localhost:3000/v1
Model: gpt-54. Codex App configuration
In the Codex App model or provider settings, choose an OpenAI-compatible / custom API provider and fill in:
| Setting | Value |
|---|---|
| API Key | your-ccx-proxy-key |
| Base URL | http://localhost:3000/v1 |
| Model | gpt-5 or your mapped model name |
5. Recommended model mapping
Codex may request GPT-style model names. If your upstream uses different model names, configure model mapping on the Responses channel:
| Request model match | Example upstream model |
|---|---|
astra | upstream flagship model |
sol | upstream primary model |
terra | upstream mid-tier model |
luna | upstream lightweight model |
codex-auto-review | upstream flagship model (auto review) |
TIP
Built-in channel presets use astra, sol, terra, luna and codex-auto-review as source model aliases; you can configure these aliases directly as model names in Codex. CCX prefers longer matching keys first, so you can also map exact model names like gpt-6.1-sol for more precise redirects.
Troubleshooting
Codex automatic review model is unavailable
If the upstream reports that codex-auto-review does not exist, add that request model to the Responses channel's model mapping and map it to a model supported by the upstream. If the channel uses a model allowlist, include either the requested model or the mapped upstream model.
The Codex App context meter does not change after setting an upstream window in CCX
A channel capability describes the actual upstream model. In the Responses channel's model capabilities, set contextWindowTokens for the mapped upstream model. When context routing is enabled, CCX uses this value to decide whether a request can be sent to that channel. This does not change the model context budget displayed by the Codex App; that value comes from Codex's client-side model configuration.
For example, if gpt-5.2 maps to deepseek-v4, configure the channel capability for deepseek-v4, not only for gpt-5.2. Check the channel log for the requested and mapped model names. To change the context usage shown in Codex, adjust the client-side budget in a Codex-supported model configuration. CCX channel capabilities affect gateway routing only.
Do Codex CLI and Codex App need separate configurations?
No. They use the same CCX OpenAI-compatible configuration:
API Key = PROXY_ACCESS_KEY
Base URL = http://localhost:3000/v1
Model = requested model nameThe CLI uses a terminal or config file. The App uses a graphical settings page.
401 Unauthorized
Check:
First check whether the current environment has
OPENAI_API_KEYset. It may override the key you entered in Codex settings.bashprintenv OPENAI_API_KEYOPENAI_API_KEYor the App API key matches CCXPROXY_ACCESS_KEYYou did not accidentally enter the upstream provider API key
CCX was started with the same
PROXY_ACCESS_KEY
404 or missing endpoint
Check Base URL.
Correct:
export OPENAI_BASE_URL="http://localhost:3000/v1"Do not use:
export OPENAI_BASE_URL="http://localhost:3000"
export OPENAI_BASE_URL="http://localhost:3000/v1/responses"model_not_found
Check the Responses channel:
- The model allowlist includes the requested model or mapped upstream model
- Model mapping covers the actual model requested by Codex
- The upstream model name is valid for that provider
Upstream says a role is unsupported
If the error mentions roles such as developer, tool, or system, edit the Responses channel and enable Normalize Non-standard Chat Roles. This is common for Chat-compatible upstreams such as DeepSeek.
Streaming output is interrupted
Check:
- The upstream reliably supports streaming responses
- Reverse proxies or network proxies do not have short timeouts
- The current channel is not circuit-broken or frequently failing over
- The client is not requesting unsupported tool calls or response formats
Confirm whether the request uses Responses
Check CCX backend logs or channel logs. The request path should be:
/v1/responsesIf you see /v1/chat/completions, the client is using OpenAI Chat configuration instead of Codex Responses configuration.