400 content[].thinking must be passed back - Claude Code
Quick fix
Upgrade cc-switch to v3.15.0 or newer to fix lost thinking blocks, or downgrade Claude Code and use the native DeepSeek Anthropic endpoint.
Symptom
Section titled “Symptom”API Error: 400 The `content[].thinking` in the thinking mode must be passed back to the API.With extended thinking on, Claude Code and Codex require the previous turn's thinking or reasoning_content block to be passed back verbatim in the next request. In versions before v3.15.0, the cc-switch protocol conversion layer failed to preserve or pass those blocks correctly, so upstream rejected the request with a 400. Different models (Kimi, for example) also expect different formats for the thinking parameter, producing similar 400s.
Upgrade cc-switch to v3.15.0 or newer; maintainers fixed the reasoning_content format conversion in that version.
If it still errors after upgrading, downgrade Claude Code to v2.1.150 or earlier (v2.1.119, for example) to work around it: npm install -g @anthropic-ai/[email protected]
For DeepSeek models, configure the native Anthropic-compatible endpoint in cc-switch rather than the OpenAI-compatible one, avoiding unnecessary format conversion.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 4 real issues
- #2769无法正常使用代理
- #3261DeepSeek V4 + Claude Code thinking mode 400 错误修复方案
- #4452使用codex配置kimi模型报错
- #6592CC Switch local proxy failed while handling Codex endpoint /responses. Provider: DeepSeek; model: deepseek-v4-flash; upstream_status: HTTP 400; cause: The `reasoning_content` in the thinking mode must be passed back to the API.
- How do I go back to an older Claude Code and turn auto-upgrade off?
- No need to uninstall first — installing a specific version through npm overwrites and downgrades it: npm install -g @anthropic-ai/[email protected].
- Why does DeepSeek error through the OpenAI-compatible endpoint?
- DeepSeek offers a native Anthropic endpoint. Going through the OpenAI-compatible one triggers cc-switch format conversion, which readily loses data in thinking mode. Use the Anthropic endpoint directly.
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.