Prices and model details on this page may have changed. For current rates, see the OpenLux pricing page.

Home / claude-sonnet-5

claude-sonnet-5 thinking and effort: how to turn thinking off, fix the 400 errors and stop truncated answers

Claude Sonnet 5 (model ID claude-sonnet-5) behaves differently from Claude Sonnet 4.6 in one way that is easy to miss: a request with no thinking field runs with adaptive thinking on Sonnet 5, while the same request ran without thinking on Sonnet 4.6. Code carried over from older models therefore tends to hit three problems: requests that still send budget_tokens return 400, thinking uses up max_tokens and the answer is cut off, and responses start with thinking blocks whose text is empty. This page relies only on Anthropic's official thinking docs, the thinking troubleshooting page, the effort docs, the Prompting Claude Sonnet 5 guide and the Claude Sonnet 5 model page. It covers what each thinking setting does on claude-sonnet-5, how to turn thinking off, how to choose an effort level and how much max_tokens to leave. If you are moving from claude-sonnet-5 to claude-sonnet-5-5 and getting 400 errors, see this site's separate page on that migration.

First: claude-sonnet-5 thinks by default when you omit thinking

The Prompting Claude Sonnet 5 guide states that adaptive thinking is on by default on Claude Sonnet 5: requests without a thinking field run with adaptive thinking. This is a change from Claude Sonnet 4.6, where the same requests ran without thinking.

When thinking runs, the content array can start with thinking blocks followed by text blocks. Anthropic's thinking docs list Claude Sonnet 5 among the models where display defaults to omitted, which returns thinking blocks with an empty thinking field while the signature field carries the encrypted reasoning. This is expected and not an error. Read the answer by block type and take the text blocks; do not read content[0].text directly.

The troubleshooting page also notes that in adaptive mode Claude skips thinking on requests it judges simple enough to answer directly, so some turns with no thinking block are normal. If you want more frequent or deeper thinking, raise effort first.

To see thinking text, send thinking: {"type": "adaptive", "display": "summarized"}. The docs state that this returns a summary of Claude's reasoning, not the raw chain of thought, and that the block is billed the same whichever display setting you use.

What each thinking setting does on claude-sonnet-5

The per-model table on Anthropic's thinking troubleshooting page lists Claude Sonnet 5 as: thinking types adaptive only, default on, and only "enabled" rejected with 400. In practice: omitting thinking runs adaptive thinking; {"type": "adaptive"} is the same; {"type": "enabled"} with budget_tokens returns 400; {"type": "disabled"} turns thinking off. The page also says only Claude Sonnet 5.5 accepts "between_tools", so sending it to claude-sonnet-5 returns 400 as well.

The budget_tokens error message from the docs is: "thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior. The Sonnet 5 guide explains that manual extended thinking was deprecated on Claude Sonnet 4.6 and is removed on Claude Sonnet 5. The fix is to send {"type": "adaptive"} or drop the thinking field, and control depth with output_config.effort instead of budget_tokens.

The between_tools error message is: "thinking.type.between_tools" is not supported for this model. If the same code serves both models, branch by model: on claude-sonnet-5 turn thinking off with disabled, on claude-sonnet-5-5 use between_tools, which that model takes in place of disabled.

To avoid hard-coding this table, the thinking docs say you can read capabilities.thinking.types.disabled.supported and capabilities.thinking.types.between_tools.supported from the Models API before sending a request.

How to turn thinking off, and when not to

To turn thinking off, add thinking: {"type": "disabled"} to the request. Do not combine it with display: the docs state that display is invalid with disabled because there is nothing to display. The footnote that restricts disabled to effort high or below applies to Claude Opus 5 and Claude Haiku 5.5; the Claude Sonnet 5 row carries no such note. If you still get a 400 after disabling thinking, compare the error message in the response body with the messages on this page.

Check your goal before disabling. If you only want to keep thinking text out of responses, you do not need to change anything: display already defaults to omitted on Claude Sonnet 5. If thinking feels too frequent or slow, the Sonnet 5 guide suggests that workloads which ran with thinking off on Sonnet 4.6 should try thinking on with lower effort levels on Sonnet 5.

The guide adds two points. Large or complex system prompts can make the model emit thinking blocks more often; you can steer it with guidance such as telling it that thinking adds latency and should only be used for problems that need multistep reasoning, and to respond directly when in doubt. Measure the effect of any such change. Second, with thinking disabled the model is less likely to reach for tools or consider searching, so if you rely on tool calls with thinking off, add an explicit nudge in the system prompt about when to use which tool.

Choosing an effort level

Effort goes in output_config.effort on the request, with five levels: low, medium, high, xhigh and max. Claude Sonnet 5 defaults to high on the Claude API and Claude Code, and the effort docs state that setting effort to the model's default produces exactly the same behavior as omitting it. adaptive is a thinking mode, not an effort level, so never put adaptive in effort.

Anthropic's guidance per level: max is absolute maximum capability with no constraints on token spending; xhigh is recommended for the hardest coding and agentic use cases; high is the default and balances token usage and intelligence for most use cases; medium suits cost-sensitive use cases that trade some intelligence for lower token usage; low is for short, scoped tasks and latency-sensitive workloads that are not intelligence-sensitive.

When migrating from Sonnet 4.6, the guide gives a rough mapping: Claude Sonnet 5 at medium is comparable in intelligence to Sonnet 4.6 at high, and Sonnet 5 at high is comparable to Sonnet 4.6 at max. When benchmarking, match by observed thinking length rather than by effort name.

Claude Sonnet 5 respects effort strictly, especially at the low end: at low and medium it scopes its work to what was asked, and moderately complex tasks at low carry some risk of under-thinking. If reasoning looks shallow on complex problems, the guide recommends raising effort to high or xhigh rather than prompting around it; if you must stay at low for latency, add a short instruction that the task involves multistep reasoning and should be thought through before responding.

Leave room in max_tokens: half an answer and stop_reason max_tokens

max_tokens is a hard limit on total output, thinking plus response text, and thinking tokens count even when the thinking text is not returned. With a tight budget you can get a response that is almost entirely thinking, followed by a truncated answer and stop_reason: "max_tokens".

The Sonnet 5 guide flags two causes after migration. Workloads that ran without thinking on Sonnet 4.6 need their max_tokens revisited. And Claude Sonnet 5 uses a new tokenizer that produces approximately 30 percent more tokens for the same text, with the exact increase depending on content, so limits tuned for Sonnet 4.6 might truncate equivalent output.

The fix is to raise max_tokens or drop to medium effort. At high, xhigh or max, leave headroom for thinking and tool calls. The model page lists 128K tokens as Claude Sonnet 5's maximum output on the synchronous Messages API.

When debugging, check stop_reason first. If it is max_tokens, the budget ran out, so raise it and retry. If it is end_turn but the answer is shorter than you expected, the guide explains that Claude Sonnet 5 calibrates response length to task complexity; ask for the level of detail you need in the prompt.

temperature, top_p and top_k also return 400

The Claude Sonnet 5 model page states that setting temperature, top_p or top_k returns a 400 error, and the prompting guide notes this constraint is new for Sonnet-class models and that these parameters should be removed when migrating.

If a claude-sonnet-5 request returns 400, check the request body your code actually sends for these three fields, including defaults set by the framework or client you use.

If you relied on temperature for stylistic variety, the guide recommends system-prompt instructions for tone and variety instead; to get meaningfully different directions across runs, it suggests asking the model to propose several distinct options first and letting the user pick one.

Multi-turn: changing effort resets the cache, and thinking blocks must be sent back unchanged

Per-message effort changes, which keep the prompt cache, are a beta feature that the effort docs list for Claude Fable 5.1, Claude Mythos 5.1, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5 and Claude Haiku 5.5. Claude Sonnet 5 is not on that list, so on claude-sonnet-5 you change effort by setting a new top-level output_config.effort on the next request, which starts the cache over.

The troubleshooting page explains that the thinking configuration and the effort level are part of the cached prompt prefix: switching thinking modes or changing effort invalidates message cache breakpoints (and can invalidate tool and system-prompt breakpoints too), and cache_read_input_tokens falls to zero. Keep both constant within a conversation. Setting a parameter explicitly to its default is equivalent to omitting it and does not invalidate the cache.

In tool-use and multi-turn conversations, send the previous assistant message back exactly as returned, including thinking and redacted_thinking blocks, even when the thinking field is empty. If your code filters blocks by type and drops redacted_thinking, or rebuilds the assistant message, the API returns a 400 whose message contains: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. The fix is to echo the content the API returned without filtering.

How to verify when calling through this relay

Parameter names, defaults and error messages on this page come from Anthropic's official docs and follow the Anthropic Messages protocol. The platform pricing API lists claude-sonnet-5 as available with anthropic and openai endpoint types. Whether the relay passes fields such as thinking and output_config through unchanged is not something the official docs cover, so confirm it with small requests.

Step 1: send a minimal request with max_tokens and no thinking or temperature fields. Confirm a 200 response and that you read the answer from the text blocks. Step 2: add thinking: {"type": "disabled"} and confirm a 200 with no thinking blocks; then switch to {"type": "adaptive", "display": "summarized"} and, on a question that needs reasoning, look for a thinking block with summary text (simple questions may skip thinking). Step 3: send the same prompt at low, medium and high and compare output tokens in usage and response time; if there is almost no difference, check whether the effort field reaches the upstream model.

Finally, run your own long tasks and confirm stop_reason is not max_tokens. Once you settle on an effort level and thinking setting, write them explicitly in code. For pricing, refer to the official pricing page.

References

Thinking (Anthropic docs): https://platform.claude.com/docs/en/build-with-claude/thinking

Troubleshooting thinking (Anthropic docs): https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting

Effort (Anthropic docs): https://platform.claude.com/docs/en/build-with-claude/effort

Prompting Claude Sonnet 5 (Anthropic docs): https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5

Claude Sonnet 5 model overview (Anthropic docs): https://platform.claude.com/docs/en/models/sonnet-5/overview

Still stuck? Full documentation and support are at https://api.openlux.ai.

More on this site

Get started

First confirm the claude-sonnet-5 group and credentials in the dashboard, then complete integration validation with a minimal request

Start with free credits

Official site: OpenLux Claude Sonnet 5 API proxy

Last updated 2026-10-30 | Written and maintained by OpenLux.
Latency and pricing figures come from our own measurements. Where they differ from the vendor's site, the vendor's live page wins.