Troubleshoot and resolve blank or mid-sentence cut-off responses in Claude Sonnet 5 across the API and third-party desktop clients ( Chatbox, AnythingLLM, etc. ) caused by adaptive thinking being enabled by default and exhausting max_tokens.
Suitable tasks: Parameter tuning and troubleshooting when connecting to Claude Sonnet 5 via API, Chatbox, AnythingLLM, or custom frontends.
Unsuitable tasks: Official Claude.ai Web interface ( the official web interface automatically handles streaming thinking blocks under the hood ) .
Applicable model version: Claude Sonnet 5 ( claude-sonnet-5 ) .
Applicable clients, agents, or APIs: Anthropic API, Chatbox, AnythingLLM, LibreChat, and various third-party API proxy tools.
Recommended reasoning levels and parameters: If deep thinking is not needed, explicitly set thinking: {type: "disabled"}; if thinking is required, max_tokens must be increased to at least 16384.
{
"model": "claude-sonnet-5",
"max_tokens": 4096,
"thinking": {
"type": "disabled"
},
"messages": [
{
"role": "user",
"content": "Your input prompt"
}
]
}{
"model": "claude-sonnet-5",
"max_tokens": 32768,
"effort": "medium",
"messages": [
{
"role": "user",
"content": "Your input prompt"
}
]
}Reproduction and Diagnosis: If you notice in your client that "the billing indicates thousands of tokens were generated, but the chat window is blank or the response is cut off mid-sentence," check the max_tokens setting in your request.
Check Thinking Budget: Sonnet 5 has thinking mode enabled by default, and thinking tokens consume the max_tokens budget first. If max_tokens is set to 2048 or 4096, the reasoning process might consume the entire budget, leaving 0 tokens for the final response.
Routing Configuration:
Simple Q&A / Summarization / Data Extraction: Add "thinking": {"type": "disabled"} to the API request body to completely prevent thinking token consumption.
Complex Coding / Multi-step Reasoning: Increase max_tokens to 16384 or 32768, and ensure the client supports independently rendering content blocks of type thinking.
Community feedback: Multiple users noticed frequent response truncation in desktop clients ( Chatbox, AnythingLLM ) after upgrading to Sonnet 5. Troubleshooting confirmed this was caused by a conflict between Sonnet 5's default thinking behavior and older clients' smaller default max_tokens values ( such as 2048/4096 ) .
API specification confirmation: In the Anthropic API, thinking tokens and visible output tokens share the total max_tokens allowance, and thinking tokens are billed at the output token rate.
Increasing max_tokens only prevents truncation; it does not reduce token consumption. Tasks with high effort will still generate a substantial amount of thinking tokens.
Some legacy third-party clients may simply drop the thinking stream if they do not parse thinking blocks, requiring a client update or disabling thinking mode.
Source feedback: "Ever since the Sonnet 5 update, I keep getting completely blank responses or text that randomly cuts off mid-sentence, despite the token counter showing Claude provided a full response."
Community solution recommendation: "Check and try setting n_predict and or token budget higher... or set thinking kwargs appropriately."
Claude Sonnet 5