thinking type should be enabled or disabled Claude Code
Quick fix
Third-party APIs require thinking param as enabled/disabled. Fix via env var CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 or alt+t toggle.
Symptom
Section titled “Symptom”API Error: 400 thinking type should be enabled or disabledClaude Code's Thinking Mode parameter defaults to true or false, but some third-party APIs (e.g., SiliconFlow) require this parameter to be exactly 'enabled' or 'disabled'. When using cc-switch for OpenAI format proxy request conversion, parameter format mismatch causes a 400 error. Additionally, SiliconFlow's Anthropic interface has thinking mode enabled by default; directly closing thinking mode and sending default requests may trigger other 400 errors such as tool calling failures. This issue appeared centrally in Claude Code version 2.1.153, while version 2.1.150 worked normally.
Press alt + t in the Claude Code interface to turn off thinking mode, then press alt + t again to turn it back on. Some models can bypass the error via this operation.
Completely disable adaptive thinking by setting the environment variable.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- Why does adding "enable_thinking": false in the config file still cause an error?
- The root cause of the error is incompatibility between parameter value formats (true/false vs. enabled/disabled). Simply modifying the boolean value cannot satisfy the third-party API's requirement for specific string formats.
- What should I do if tool calls keep returning 400 after turning off thinking mode?
- SiliconFlow's Anthropic interface has thinking mode enabled by default. Closing thinking mode and sending default requests may cause tool calling anomalies. It is recommended to try setting the environment variable CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 to completely disable adaptive thinking.
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.