Codex error after enabling local proxy
Quick fix
Add /v1 to the end of the Codex provider request URL in CC Switch, save, and retry.
Symptom
Section titled “Symptom”开启本地代理后 Codex 报错Codex reports an error after enabling the local proxy
After enabling cc-switch's local proxy for Codex, Codex sends requests to the local proxy address, and cc-switch forwards them to the provider's configured request URL. Codex natively uses the OpenAI Responses format; if the provider request URL does not end with `/v1`, or points to an incompatible Chat Completions endpoint, the response format returned by the provider does not match what Codex expects, and Codex reports an error. In #651, after the maintainer confirmed "add the /v1 suffix to the request URL", the user replied "solved". Other reports in the same cluster are variants of this proxy chain: #1586 is about the model name not being overridden, requiring confirmation that the endpoint is "a server endpoint compatible with the OpenAI Response format", since cc-switch does not perform format conversion for Codex; #1515 is about CLI model changes not automatically syncing to the config after the proxy starts; #4177 and #5526 are duplicate usage statistics (fork/archived history copying, and logical model aliases not matching resolved models); #4188, #4189, and #4190 are attribution, truncated stream, and input_file/input_audio issues in the format conversion path, confirmed by the maintainer as covered on the main branch; #3970 is about the proxy service address being read-only in the UI.
] In CC Switch's Codex provider configuration, change the request URL to one ending with `/v1`.
Save and re-trigger a Codex request to confirm the error is gone; in #651 the user confirmed "solved".
If it still errors, check whether the server 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 doesn't the model name configured in cc-switch override the `gpt-5.4` selected by Codex?
- Confirm that you entered a server endpoint compatible with the OpenAI Response format. cc-switch does not perform format conversion for Codex; the CLI can pass a model name via `-m`, but the VS Code extension cannot pass parameters when launching (#1586).
- After starting the proxy, why don't model changes made in the CLI automatically sync to the config file?
- Enabling the proxy requires taking over model mapping; CLI model changes are not automatically written back to cc-switch. Modify the cc-switch config instead, or avoid changing the model while it is being managed (#1515).
- Why do so many extra `Codex (Session)` records suddenly appear in usage statistics after forking Codex?
- Parent session history copied in fork/archived JSONL may be imported twice (#4177); additionally, mismatches between the logical model alias in session logs and the resolved model recorded by the proxy can cause deduplication of the same request to fail (#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.