The `content[].thinking` in thinking mode must be passed back to the API - Claude Code
Quick fix
Some variants remain unresolved: upgrade to a version with the thinking history normalization fix; for Codex routed through DeepSeek, use a version with the…
Symptom
Section titled “Symptom”API Error: 400 The `content[].thinking` in the thinking mode must be passed back to the API.Compatible endpoints such as DeepSeek require thinking content matching the conversation history to be sent back in multi-turn thinking conversations. During context compaction, provider switching, or tool calls, Claude Code may produce thinking history that is missing, truncated, or has an incompatible signature. CC Switch's protocol conversion may also fail to preserve this content, causing the upstream service to return 400. The same issue has also been reported with Kimi/Moonshot. Disabling thinking or starting a new session can temporarily work around it in some reports, but may reduce reasoning capability or lose context.
Fix status varies by client path. Reports say CC Switch v3.16.0 fixed DeepSeek history normalization, which was later extended to Kimi/Moonshot. The Claude Code path has a separate normalization note starting with v3.20.0. A v3.20.3 report says the Codex-to-Anthropic Messages path still lacked this handling; the maintainer said PR #7605 added normalization for DeepSeek/MiMo after conversion. A report of persistent 400 errors after failover hot switching in v3.20.1 remains open, and the cause has not been confirmed; it cannot be considered fixed based on that report.
When Claude Code uses the DeepSeek Anthropic endpoint, upgrade to v3.16.0 or later; the report recommends v3.16.2. The newer Claude path also has normalization starting with v3.20.0. If the issue still reproduces after upgrading, record the CC Switch version, client version, provider configuration, and reproduction steps.
When Codex is routed through CC Switch to an Anthropic Messages endpoint, confirm that your version includes the post-conversion thinking normalization described in PR #7605; the report says this path still had a gap in v3.20.3. The available issues do not specify a released version, so they do not establish which version to upgrade to.
If an old Claude Code session errors after switching providers, try starting a new session or clearing the old context; users reported this worked for that scenario.
Some users reported that adding `"thinking": false` to the DeepSeek provider configuration bypassed the error, but this disables thinking. Its applicability and effectiveness have not been confirmed across all issues.
// 配置文件路径未在 issue 中提供{"thinking": false}
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 13 real issues
- #2277deepseekv4发布了,如何使用cc switch 使之适配claude code终端
- #2282cc switch接deepseek V4报“API Error: 400 {"error":{"message":"The `content[].thinking` in the thinking mode must be passed back to the API.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}”
- #2331[Bug] 临时解决方案Claude Code 与 DeepSeek V4-Flash 工具调用报错:缺少 reasoning_content 导致 400 Invalid Format
- #2401其他模型对话不兼容deepseek对话,如其他模型到额度预警,切换到deepseek,当前对话会报The content[].thinking in the thinking mode must be passed back to the API.
- #3200DeepSeek v4pro报错API400
- #3222DeepSeek V4 /anthropic 端点:tool_use 消息缺少 thinking block 导致 HTTP 400
- #3233API Error: 400 The `content[].thinking` in the thinking mode must be passed back to the API.
- #3263[Bug] DeepSeek Anthropic API thinking block round-trip 导致 400 错误 + Feature Request
- #3287API Error: 400 The content[].thinking in the thinking mode must be passed back to the API.
- #3304API Error: 400 The content[].thinking in the thinking mode must be passed back to the API.
- #3315使用claude desktop配置时调用deepseek写code时会出错
- #7226[Bug] 故障转移热切换模型导致 thinking 模式请求持续 HTTP 400
- #7525使用claude code 桌面调用deepseek 模型报错
- Can starting a new session resolve this error?
- Users reported that exiting the old session or running `/clear` and starting again resolved errors after switching from another provider to DeepSeek; this clears the old session context.
- Can disabling thinking work around the error?
- Users reported that setting `"thinking": false` in the DeepSeek provider configuration resolved it, but this disables thinking mode, and not all reports confirm that the method works.
- Can Codex also encounter this when calling DeepSeek?
- Yes. Issue #7525 reports that requests with tool calls still errored when Codex was converted through CC Switch to Anthropic Messages. The maintainer said PR #7605 added normalization for this conversion path, but the issue does not specify a corresponding release version.
- What should I do if errors persist after automatic failover and switching back to the original model does not help?
- Issue #7226 reports persistent 400 errors after hot switching models within the same Codex session; the user could only abandon that session and start again. The issue remains open, and no fix has been confirmed.
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.