Skip to content

HTTP 400 Codex /responses Request Failure

Quick fix

Check whether the provider supports Codex’s request format. If it natively supports the Responses API, set apiFormat to openai_responses to avoid conversion.

Error output
CC Switch local proxy failed while handling Codex endpoint /responses. Provider: OpenCode Go ox alpha; model: ox-alpha-free; upstream_status: HTTP 400; cause: Error from provider (Console Go): Upstream request failed: [1210] Invalid API parameter, please check the documentation.

These issues all involve an upstream HTTP 400 response to a Codex /responses request, but the causes differ. Some relate to how the client or provider handles request fields and parameters. Another case reports that when the provider is configured as openai_chat, CC Switch converts Responses requests to Chat Completions, and the conversion may produce invalid JSON. In that case, the provider natively supported the Responses API, and changing apiFormat to openai_responses made the request succeed. Another case only reports a provider parameter error after viewing a generated image, without a verified fix.

  1. Confirm that the provider supports the API format used by the current Codex request. If the provider natively supports the Responses API, set that Codex provider’s apiFormat to openai_responses to avoid conversion; this change was verified in one issue.

    // 配置文件路径:issue 未提供
    // 不提供配置差异:issue 未提供具体文件路径或配置格式
  2. If you still receive HTTP 400 after switching to openai_responses, check request compatibility between the client and provider; the available issues do not provide a general fix for all providers.

ToolCodex
Versioncc-switch 3.17.0 - 3.20.2(报告版本范围;未说明修复版本)
PlatformsWindowsmacOS
Can starting a new conversation solve this?
A user in an issue suggested trying a new conversation, but the reporter said the problem persisted in a new conversation, so this is not a confirmed fix.
Why change apiFormat to openai_responses?
In one issue, the provider natively supported /v1/responses; after changing to openai_responses, a request with the full payload returned 200.

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.