Skip to content

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.

Error output
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.

  1. Upgrade cc-switch to v3.15.0 or newer; maintainers fixed the reasoning_content format conversion in that version.

  2. 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]

  3. For DeepSeek models, configure the native Anthropic-compatible endpoint in cc-switch rather than the OpenAI-compatible one, avoiding unnecessary format conversion.

ToolClaude Code / Codex
Versioncc-switch < 3.15.0 (affected), >= 3.15.0 (fixed)
PlatformsWindows
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.

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.