Skip to content

CC Switch local proxy failed while handling Codex /responses

Quick fix

Upgrade CC Switch to the latest version and start a new Codex conversation; invalid schema or image blocks left in old session history will keep triggering 400.

Error output
CC Switch local proxy failed while handling Codex endpoint /responses. Provider: DeepSeek; model: deepseek-v4-flash; upstream_status: HTTP 400; cause: Invalid schema for function 'codex_app__automation_update': schema must be a JSON Schema of 'type: "object"', got 'type: null'.

The Codex client mandates the Responses API (`/responses` endpoint), while third-party providers (DeepSeek, 智谱 GLM, Kimi, etc.) only support the Chat Completions format. The CC Switch local proxy has multiple conversion defects when transforming Responses requests into Chat Completions format, causing upstream to return HTTP 400. These defects involve tool schema conversion, image block mapping, context limit overflow, and message ID format. The most common cause is that the schema for the Codex built-in tool `codex_app__automation_update` uses `oneOf` at the top level but lacks `type: "object"`; CC Switch does not apply fallback completion and passes it through directly to upstream, resulting in rejection. Additionally, when sending images to non-multimodal models (such as DeepSeek, GLM), the `input_image` type is not filtered or converted, also triggering 400. Some issues have been fixed in v3.17.0 and subsequent versions, but certain scenarios (such as xAI OAuth, Kimi `$ref` validation) remain unresolved in the latest version.

  1. Upgrade CC Switch to the latest version. v3.17.0 fixed the `codex_app__automation_update` schema `type: null` fallback issue, and subsequent versions progressively fixed image block conversion and other problems.

  2. Start a new conversation in Codex. Old session history may retain invalid schema or `image_url` blocks; even after upgrading CC Switch, resending history will still trigger the same 400 error.

  3. If using non-multimodal models such as DeepSeek or GLM, avoid sending images in Codex. These models do not support `image_url` or `input_image` type content blocks; sending images will inevitably cause 400.

  4. Check the `~/.codex/config.toml` configuration to ensure `wire_api = "responses"` and `base_url` points to the CC Switch local proxy address (typically `http://127.0.0.1:15721/v1`).

ToolCodex
Version3.16.1 - 3.20.0(受影响范围)
PlatformsmacOSWindows

This page is distilled from 43 real issues

Why does it still report errors after upgrading to the latest version?
Old session history has already saved invalid schema or image blocks. Codex includes the full history in every request, causing upstream to continuously return 400. You must start a new conversation to resolve this.
Sending images causes an error, but text conversation works fine. Is this a CC Switch bug?
Some models (such as certain versions of DeepSeek, GLM) do not support multimodal input. When CC Switch forwards requests containing images without filtering image blocks for non-multimodal models, it triggers 400. Upgrading to the latest version can improve this, but the fundamental solution is to use a model that supports multimodal input.
What does the error `Invalid schema for function 'codex_app__automation_update'` mean?
The Codex built-in `codex_app__automation_update` tool uses a `oneOf` JSON Schema structure, missing `type: "object"` at the top level. CC Switch does not complete this field during format conversion, causing strict upstream API validation to fail. v3.17.0 fixed this issue.
What should I do when using Kimi model and getting `tools.function.parameters is not a valid moonshot flavored json schema`?
This is a strict schema validation rule specific to Moonshot (Kimi), requiring that `$ref` references cannot coexist with sibling keywords. This issue is not fully fixed in v3.20.0; recommend monitoring subsequent version updates.
What causes the errors `level "max" not supported` or `max_tokens must be at least 1, got -1712`?
The former is caused by incomplete reasoning effort level mapping in Codex Desktop for specific models (such as `gpt-5.6-sol`); the latter is a negative overflow when CC Switch calculates `max_tokens`. Both are CC Switch conversion logic defects; recommend upgrading to the latest version and monitoring related issue progress.

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.