Skip to content

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.

Error output
开启本地代理后 Codex 报错
English translation

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.

  1. ] In CC Switch's Codex provider configuration, change the request URL to one ending with `/v1`.

  2. Save and re-trigger a Codex request to confirm the error is gone; in #651 the user confirmed "solved".

  3. 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.

ToolCodex
Version3.16.2 - 3.17.0(受影响范围)
PlatformsWindowsmacOSLinux
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).

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.