Claude Sonnet 4 After Retirement: Where It Runs and How to Move
Anthropic retired Claude Sonnet 4 on its own API in June 2026. What the model was, where it still runs, and what breaks when you migrate to Sonnet 5.5.
If you have a service still pinned to claude-sonnet-4-20250514, the first thing to know is that it no longer answers on Anthropic's own API. Anthropic deprecated Sonnet 4 on 14 April 2026 and retired it there on 15 June 2026. Requests to a retired model fail rather than degrade.
That does not mean the model vanished. Partner clouds set their own schedules, and Anthropic's migration guide states that Sonnet 4 is still available on Amazon Bedrock and Google Cloud. So the useful question is not "is it gone" but "how long do I want to depend on it, and what does moving cost me".
What Sonnet 4 was
Sonnet 4 launched on 22 May 2025 alongside Opus 4, and it was the model that made the Claude 4 generation feel like a step rather than a point release. Anthropic positioned it as an instant upgrade from Sonnet 3.7: better coding and reasoning, more precise instruction following, and more steerable behaviour.
The launch numbers that mattered:
- SWE-bench Verified — 72.7% in the standard setting, and 80.2% with Anthropic's high-compute parallel method.
- GPQA Diamond — 70.0% without extended thinking.
- MMMU — 72.6%, which reflected solid image understanding for a text-out model.
It was a hybrid model: near-instant answers by default, with an extended thinking mode you switched on and gave a token budget. A beta at launch let it call tools such as web search during that thinking, alternating between reasoning and acting. Anthropic also reported that both Claude 4 models were 65% less likely than Sonnet 3.7 to take shortcuts or exploit loopholes on agentic tasks prone to that behaviour.
Pricing was $3 per million input tokens and $15 per million output, the same as earlier Sonnets. The standard context window was 200K tokens; in August 2025 Anthropic added a 1M-token window in beta behind the context-1m-2025-08-07 header, with higher rates for prompts over 200K.
Where it still runs, and for how long
The catalogue entry this guide is based on still lists Sonnet 4 on OpenRouter at $3 input and $15 output per million tokens, with cache reads at $0.30, a 200K context window and up to 64K output tokens. Listings like this are served by whichever upstream still hosts the model, so availability now depends on partner clouds rather than on Anthropic.
That is the real risk. Bedrock and Google Cloud publish their own retirement dates, and a model already retired by its maker is an obvious candidate for the next round. If Sonnet 4 is load-bearing in production, treat its remaining life as borrowed time and plan the move now, while a rollback is still possible.
The recommended replacement is two generations on
Anthropic's deprecation table names claude-sonnet-5-5 as the replacement for Sonnet 4, skipping Sonnet 4.5, 4.6 and 5 entirely. On paper the trade is generous: Sonnet 5.5 lists at $2 input and $10 output per million tokens, with a 1M context window as standard and 128K maximum output.
Two things blunt the price cut. First, the newer tokenizer produces more tokens for the same text; Anthropic puts it at about 30% more against Sonnet 4.5 and 4.6, depending on content, so recount your real prompts rather than assume. Second, Sonnet 5.5 thinks by default. A request with no thinking field now runs adaptive thinking, which spends output tokens Sonnet 4 never spent on the same call.
The net effect on your bill could go either way. The only honest way to find out is to replay a sample of real traffic through both and compare cost per completed request, not price per token.
What breaks when you migrate
The jump spans several API changes, and most of them fail loudly with a 400 error rather than quietly. From Anthropic's migration guide, the ones that hit Sonnet 4 code:
- Thinking budgets.
thinking: {type: "enabled", budget_tokens: N}is rejected. Replace it with an effort level inoutput_config.effort. - Sampling parameters. Non-default
temperature,top_portop_kreturn an error. Remove them and steer with the prompt instead. - Prefill. A conversation that ends with a partial assistant turn is refused. If you used prefill to force JSON, move to structured outputs.
- Forced tool use. A
tool_choiceof typeanyortoolis rejected; useautowith strict tool schemas. - Tool versions and headers. Move to
text_editor_20250728and the current code execution tool, and drop thetoken-efficient-tools-2025-02-19,output-128k-2025-02-19and 1M context beta headers. - New stop reasons. Handle
refusalandmodel_context_window_exceeded, neither of which your Sonnet 4 code ever had to see.
There is a quieter change too: newer models keep trailing newlines in tool call string parameters. If a tool handler compares strings exactly, that can break without any error at all.
A migration plan that does not rely on luck
Do it in this order:
- Pull a week of real Sonnet 4 requests, including the awkward ones, and freeze them as a replay set.
- Port the request code to Sonnet 5.5 and fix every 400 before judging any output.
- Run the replay set at
mediumandhigheffort. Record output tokens, latency and whether you would accept each answer. - Review the prompts themselves. Anthropic's guide lists a prompt review against its prompting best practices as a step for anyone coming from Sonnet 4, so re-read any instruction that was written to work around an older model's habits.
- Cut over behind a flag, with the partner-cloud Sonnet 4 endpoint as the fallback until the numbers settle.
How to benchmark LLMs on your own work covers building that replay set properly. If a full jump to 5.5 is too much change at once, the Sonnet 5 guide covers the intermediate model, which still accepts forced tool use. For the destination itself, see the Claude Sonnet 5.5 guide.
Common questions
Is Claude Sonnet 4 still available?
Not on Anthropic's own API: it was retired there on 15 June 2026 and requests fail. Anthropic says it remains available on Amazon Bedrock and Google Cloud, which set their own retirement dates, so expect that to end too.
What should I replace Claude Sonnet 4 with?
Anthropic recommends Claude Sonnet 5.5. It is cheaper per token and has a 1M context window as standard, but it uses a tokenizer that produces more tokens and thinks by default, so measure real cost per request before assuming savings.
Why does my Sonnet 4 code return 400 errors on newer Claude models?
Thinking budgets, non-default temperature or top_p, assistant prefill and forced tool choice are all rejected on Sonnet 5.5. Replace budgets with an effort level, drop sampling parameters, and use structured outputs or strict tools instead.