Skip to content

schema must be a JSON Schema of 'type: "object"', got 'type: null' - Codex with DeepSeek

Quick fix

This is a conversion defect in older versions of CC Switch. Upgrade to v3.18.0 or later to fix it; no manual changes to config.toml are needed.

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

Codex built-in tools (such as codex_app__automation_update for scheduled tasks and computer control) declare the parameters field as JSON null in the Responses API. When CC Switch converts a request from Responses format to an upstream Chat Completions API such as DeepSeek, it does not handle an empty schema, so the upstream returns HTTP 400. The issue was still unfixed in v3.17.0 (the related code path transform_codex_chat.rs did not handle explicit null) and was fixed in v3.18.0 through merged PRs #4706 and #5315. The proxy now automatically normalizes tool parameters to {"type":"object"}. Some users also encounter HTTP 400 due to an upstream context limit (such as exceeds the available context size) or a misspelled model name (such as deepseek-v4-falsh), but these are different triggers from schema validation.

  1. Upgrade CC Switch to v3.18.0 or later (download from https://github.com/farion1231/cc-switch/releases/latest)

  2. No manual changes to config.toml are needed. If you changed it manually before, switch the DeepSeek provider's Upstream Format to Responses (native) in the CC Switch interface and turn off the routing button.

  3. Restart the Codex client and check whether scheduled tasks, plugin calls, and other features work again.

ToolCodex
Version3.16.1 - 3.17.0(v3.18.0 修复)
PlatformsWindowsmacOS
Why does Codex stop working after I set Upstream Format to Responses (native) and turn off the routing button?
Native Responses support was introduced in v3.18.0, but if you had already configured routing manually, turning it off may cause requests to bypass the local proxy conversion and fail directly. After upgrading, use the default Responses mode, or turn routing back on so CC Switch can handle format conversion.
Do I still need to edit config.toml manually after upgrading?
No. v3.18.0 includes compatibility handling for strict upstreams such as DeepSeek. Switch providers directly in the interface; there is no need to edit the configuration file manually.
Does this fix work on both Windows and macOS?
Yes. Users on both Windows and macOS have confirmed that switching to Responses mode works after the v3.18.0 fix.
Is an HTTP 400 error after exceeding 256K of context the same issue?
No. That means the context length exceeds the model's window limit (such as the 256K limit for Qwen3.6 or DeepSeek). Check that the context window is set correctly in the CC Switch model table, or use automatic compaction. This has a different root cause from the schema validation error.
Why can't DeepSeek recognize images?
The DeepSeek deepseek-v4-pro model itself is not multimodal and does not support image input. This is unrelated to CC Switch; use a multimodal model or wait for official DeepSeek support.

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.