Codex errors after enabling the local proxy
Quick fix
Add /v1 to the end of the Codex provider request address in CC Switch, save, and retry.
Symptom
Section titled “Symptom”开启本地代理后 Codex 报错Codex errors after enabling the local proxy
With the cc-switch Codex local proxy on, Codex sends requests to the local proxy address and cc-switch forwards them to the request address configured on the provider. Codex natively uses the OpenAI Responses format. If the provider request address does not end in `/v1`, or points at an incompatible Chat Completions endpoint, the response format the provider returns does not match what Codex expects and Codex errors. In #651 a maintainer confirmed "add the /v1 suffix, configured in the request address", and the user replied that it was solved.
Other reports in the same cluster are variants on that proxy path. #1586 is the model name not being overridden, where you have to confirm you entered a "service endpoint address compatible with the OpenAI Response format" — cc-switch does no format conversion for Codex. #1515 is that changing the model in the CLI after starting the proxy does not sync back to the config. #4177 and #5526 are duplicate usage counting (copied fork/archived history, and a logical model alias disagreeing with the resolved model). #4188, #4189, and #4190 are attribution, truncated streams, and input_file/input_audio problems on the format conversion path, which a maintainer confirmed are covered on main. And #3970 is the proxy service address being read-only in the UI.
In the CC Switch Codex provider config, change the request address to one ending in `/v1`.
Save and trigger a Codex request again to confirm the error is gone; the user in #651 confirmed it was solved.
If it still errors, check the endpoint you entered is compatible with the OpenAI Response format — cc-switch does not convert Codex requests to Chat Completions.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 9 real issues
- #651开启本地代理后 Codex 报错
- #1515codex 启动代理后,存在的多个配置文件不会自动同步codex cli中的变化。
- #1586codex无法覆盖模型名称
- #3970[Bug] Proxy Service address is read-only and can only be copied
- #4177Codex usage import double-counts forked/archived session history
- #4188Codex format-conversion usage should be attributed to the real routed upstream model
- #4189Codex Chat streaming bridge should not treat truncated upstream streams as successful completions
- #4190Codex Responses to Chat conversion should preserve input_file and input_audio parts
- #5526Codex session/proxy dedup fails when logical model alias differs from resolved model
- Why does the model name configured in cc-switch not override the `gpt-5.4` Codex selected?
- Confirm you entered a service endpoint address compatible with the OpenAI Response format. cc-switch does no format conversion for Codex. The CLI can pass a model name with `-m`, while the VS Code plugin cannot be started with arguments (#1586).
- After starting the proxy, why does changing the model in the CLI not sync to the config file?
- Enabling the proxy requires taking over model mapping, so a model change in the CLI is not written back to cc-switch. Change the cc-switch config instead, or do not change the model while takeover is on (#1515).
- Why do many `Codex (Session)` records appear in usage statistics after a Codex fork?
- Parent session history copied into the fork/archived JSONL can be imported twice (#4177). Separately, a logical model alias in the session log disagreeing with the resolved model the proxy recorded also breaks deduplication for the same request (#5526).
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.