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.
Symptom
Section titled “Symptom”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.
Upgrade CC Switch to v3.18.0 or later (download from https://github.com/farion1231/cc-switch/releases/latest)
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.
Restart the Codex client and check whether scheduled tasks, plugin calls, and other features work again.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 16 real issues
- #3777Qwen3.6 256K上下文问题
- #3921Codex配置了deepseek-v4-pro后无法识别图片
- #4615claude-desktop 代理将子代理(Agent/Subagent)的已解析模型名拒返回 400
- #4793schema must be a JSON Schema of 'type: "object"', got 'type: null'.
- #4803设置定时任务,调用tool出现: model: deepseek-v4-pro; 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'.
- #4839codex 通过 cc 转发到deepseek的 创建定时任务提示词 报错
- #5009codex接入deepseek messages.tool_call_id 报错问题一直没有解决
- #5048[Bug] DeepSeek 返回 400: function schema 缺少 type: "object"
- #5340有报错
- #5354CC switch Codex使用deepseek fail。
- #5384接入deepseek,所有插件无法使用
- #5426codex 接入deepseek, 还是400报错
- #5528[@chrome](plugin://chrome@openai-bundled) 打开Product Hunt 首页,找出今天最热门的3个新发布产品,总结它们各自的特点,并附上对应的访问链接。出错
- #5576在openai中使用电脑操控插件无法正常使用(使用deepsdseeek接入)
- #5959Deepseek v4 flash正式版发布后 兼容性问题
- #7127使用gpt work时自动化任务cc-switch转发给deepseek时的bug
- 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.
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.