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

Home / claude-sonnet-5

Switched claude-sonnet-5 to claude-sonnet-5-5 and got a 400? Check thinking, tool_choice and computer use first

If you changed the model name from claude-sonnet-5 to claude-sonnet-5-5 and the request now fails with a 400, check three things first: whether the request sets thinking to {"type": "disabled"}, whether tool_choice is any or tool, and whether you declare the computer_20251124 computer use tool. Anthropic's Claude Sonnet 5 model page now marks the model as legacy, and the official Claude Sonnet 5.5 migration guide has a dedicated section for moving from Claude Sonnet 5. This page walks through each 400 from that guide, the code change, the response changes that do not raise an error, and how to confirm the migration works.

Why does a working claude-sonnet-5 request return 400 on claude-sonnet-5-5?

Anthropic's Claude Sonnet 5 model page says the model was released on June 30, 2026, its status is Active (legacy), and retirement is not sooner than June 30, 2027. The page recommends considering a move to Claude Sonnet 5.5. So claude-sonnet-5 keeps working for now and upgrading is optional, but an upgrade is more than a model name change.

The migration guide names five settings that return a 400 on claude-sonnet-5-5: thinking budgets (budget_tokens), sampling parameters (temperature, top_p, top_k), assistant prefill, forced tool choice (tool_choice of type any or tool), and thinking: {"type": "disabled"}. Three of these already fail on Claude Sonnet 5: the Sonnet 5 page says temperature, top_p or top_k return a 400; the guide says prefill is rejected on Claude Sonnet 5 as well; and the guide's thinking table lists only adaptive and disabled as the thinking types Claude Sonnet 5 accepts, so type enabled with budget_tokens is not among them. Code that runs on claude-sonnet-5 today therefore mostly needs two new changes: thinking disabled and forced tool_choice.

Two more situations also return a 400: sending the computer_20251124 computer use tool on the Claude API, and using Claude Sonnet 5 as the advisor model in the advisor tool. The sections below cover each one.

Official sources: Claude Sonnet 5 model page https://platform.claude.com/docs/en/models/sonnet-5/overview and Claude Sonnet 5.5 migration guide https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide .

thinking type disabled returns 400: switch to between_tools

On Claude Sonnet 5 you turn thinking off with thinking: {"type": "disabled"}. According to the migration guide, Claude Sonnet 5.5 accepts only two thinking types, adaptive and between_tools, and disabled returns a 400 invalid_request_error. The error text reads: To turn thinking off on this model, send "thinking": {"type": "between_tools"} instead of {"type": "disabled"}.

between_tools is the lowest thinking setting on Claude Sonnet 5.5. The model does not think before responding, but the short progress updates it writes between tool calls still come back as thinking blocks. Without tools, the response contains only text. It works on every platform that offers Claude Sonnet 5.5 and needs no beta header.

Three limits apply, and each one returns a 400 if you break it. First, between_tools is accepted only at low, medium and high effort; xhigh or max returns an error, so to run at those levels omit the thinking field or send {"type": "adaptive"}. Second, between_tools takes no other field: sending display, budget_tokens or block_binding with it returns an error. Third, with between_tools the effort cannot change mid-conversation: a per-message output_config.effort that differs from the level in effect returns an error. If you need a different effort on each turn, use adaptive thinking.

The guide's own before and after example: the claude-sonnet-5 request sends thinking disabled with output_config.effort xhigh; the claude-sonnet-5-5 version sends thinking between_tools with effort high, since between_tools accepts only low, medium and high.

tool_choice: type "tool" and "any" are not supported: switch to auto with strict tools

Every earlier model covered by the migration guide accepts tool_choice of type any or tool. Claude Sonnet 5.5 rejects both with a 400, and the guide notes this also applies to the token counting endpoint. The error message is: tool_choice: type "tool" and "any" are not supported for this model.

The official fix is to send tool_choice: {"type": "auto"} and mark the tool strict: true so its input matches the input_schema. With auto, the model can answer without calling the tool, so say in the prompt when it should use the tool. The guide's example forces get_weather on Claude Sonnet 5 and, on Claude Sonnet 5.5, switches to auto with a strict get_weather tool.

Strict tools have their own limits. Strict tool use supports a subset of JSON Schema and needs additionalProperties: false on every object. A request can have at most 20 strict tools, and the MCP, computer use and browser use toolset entries do not accept strict. In a longer tools list, mark only the tools that need it. Details: https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use .

Computer use and advisor tool 400s: what to change

Computer use: on the Claude API and on Claude Models on Google Cloud (Google managed), Claude Sonnet 5.5 supports computer use only through the computer_toolset_20260801 toolset, and computer_20251124, the version Claude Sonnet 5 code usually sends, returns a 400 there. On Amazon Bedrock you keep sending computer_20251124. Claude Sonnet 5.5 does not accept computer_20250124 on any platform.

If your request also sends the fine-grained-tool-streaming-2025-05-14 beta header, remove it when you move to the toolset, because the header returns a 400 alongside a toolset entry. Set eager_input_streaming: true on each tool that needs streamed input instead. Code that already sends the toolset needs no change.

Advisor tool: with a Claude Sonnet 5.5 executor, the advisor must be one of Claude Opus 5, Claude Opus 5.5, Claude Sonnet 5.5, Claude Fable 5, Claude Fable 5.1, Claude Mythos 5 or Claude Mythos 5.1. Claude Sonnet 5 is on the list of advisors that return a 400, together with Claude Opus 4.8, 4.7, 4.6, Claude Sonnet 4.6 and Claude Haiku 5.5. Also note that the advice comes back encrypted as an advisor_redacted_result block, so its text is not readable in the response.

No 400, but the output looks different: response changes to handle

Keep conversations append-only. Each Claude Sonnet 5.5 thinking block is signed over the conversation before it. For accounts created on or after August 31, 2026, 00:00 UTC, the API enforces this by default on the Claude API, Amazon Bedrock and Claude Models on Google Cloud (Google managed), and replaying a block after editing earlier history returns a 400. To change instructions or tools, the guide recommends mid-conversation system messages. Pass thinking blocks back unchanged in tool-use loops, including empty ones.

Text between tool calls moves into thinking blocks. On Claude Sonnet 5, all text the model writes between tool calls comes back as text blocks. On Claude Sonnet 5.5, notes longer than a sentence or two come back as progress-update thinking blocks, which are empty at the default display. No request fails, but an interface that showed those notes goes quiet. With adaptive thinking, set display to summarized, or to updates (beta, thinking-display-updates-2026-08-18 header) to get only the updates. With between_tools, the text comes back without setting display.

More refusal categories. Claude Sonnet 5.5 declines in more categories than Claude Sonnet 5. A decline returns stop_reason refusal, and stop_details can name cyber, bio, frontier_llm, reasoning_extraction or general_harms. Make sure your code handles this stop reason instead of assuming text is present. Server-side fallback (fallbacks: "default"), in beta on the Claude API and on Claude Models on Google Cloud (Anthropic managed), retries cyber and frontier_llm declines on Claude Sonnet 5; it does not retry bio, reasoning_extraction or general_harms declines.

Other differences: the minimum cacheable prompt drops from 1,024 tokens on Claude Sonnet 5 to 512 tokens. Effort has five levels (low, medium, high, xhigh, max) with high as the default on the Claude API, but the levels are recalibrated, so the same level does not produce the same amount of thinking as on Claude Sonnet 5. The guide recommends re-running your effort sweep and re-baselining cost. For the price difference between the two models, check the official pricing page.

How to verify the migration worked

Step 1: send a minimal request. Set model to claude-sonnet-5-5 with max_tokens and output_config.effort, and leave out temperature, top_p, top_k, prefill and thinking disabled. A 200 response confirms the model name and base parameters are accepted. Read the result by block type and take the text blocks; do not read content[0].text directly, because a response can start with thinking blocks.

Step 2: add back the settings your application uses, one at a time. Use between_tools if you need to skip up-front thinking, tool_choice auto with strict tools where you used to force a tool, and computer_toolset_20260801 for computer use. After each addition, confirm the request still returns 200 and that tool call inputs match your schema.

Step 3: if you still get a 400, read the error message in the response body and match it to the sections above: a message that mentions between_tools points to the thinking setting, a message that mentions tool_choice points to forced tool use, and if the request contains a computer use tool or the fine-grained-tool-streaming header, compare it with the computer use section. The migration guide also offers a Claude Code command that applies the changes for you: /claude-api migrate this project to claude-sonnet-5-5. Review the result against this checklist afterwards.

Calling through this relay: the platform pricing API lists both claude-sonnet-5 and claude-sonnet-5-5 as available, with anthropic and openai endpoint types. The parameters above follow the Anthropic Messages protocol. Whether fields such as thinking, tool_choice and output_config pass through the relay unchanged should be confirmed from the actual response, so test with a small request before moving production traffic.

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.