How to Migrate a Production Agent from Claude Sonnet 4.5

Published Sources reviewed October 6, 20267 min read

Anthropic deprecated Claude Sonnet 4.5 on September 30, 2026 and will retire it on the Claude API on November 30, 2026; after that, requests fail. The recommended replacement is Claude Sonnet 5.5. Several settings agents commonly use now return errors, and some behaviors change.

This guide lists what breaks, what to re-test, and a migration plan that keeps rollback possible until the deadline. It is part of the AI agent optimization hub.

The short version

Fix the API errors first: they fail loudly. Then test the behavior changes that fail quietly, especially tool calls the model may now skip. Compare old and new on the same scenarios before the switch, and keep the old model as a fallback only until November 30.

What happens on November 30

The dates below apply to Anthropic-operated platforms: the Claude API, Claude Platform on AWS, and Microsoft Foundry. Amazon Bedrock and Google Cloud set their own retirement schedules, so check your provider's model table if you call Claude there.

Claude Haiku 4.5 is not in this list. As of October 6, 2026 it is active, with retirement not sooner than October 15, 2026 and no retirement date announced.

Model ID
claude-sonnet-4-5-20250929
Deprecated
September 30, 2026
Retires
November 30, 2026
Recommended replacement
claude-sonnet-5-5

API changes that break agent code

These return a 400 error on Claude Sonnet 5.5, so they show up immediately in testing. Anthropic's migration guide lists the full set; these are the ones agents hit most often.

What your code does today
Prefills the last assistant turn
What happens on Sonnet 5.5
400: the model does not support assistant message prefill
Fix
Structured outputs or strict tools for format; system-prompt instructions for preambles; move continuations to the user turn
What your code does today
Forces a tool with tool_choice any or tool
What happens on Sonnet 5.5
400: forced tool use is not supported
Fix
tool_choice auto with strict: true, and say in the prompt when the tool must be used
What your code does today
Sets thinking enabled with budget_tokens
What happens on Sonnet 5.5
400: use adaptive thinking and an effort level
Fix
Remove the budget; set output_config.effort and evaluate two or three levels
What your code does today
Sets non-default temperature, top_p, or top_k
What happens on Sonnet 5.5
400 on Claude 4.7 and later models
Fix
Remove them and steer behavior with the prompt
What your code does today
Sends output_format
What happens on Sonnet 5.5
400 without the structured-outputs beta header
Fix
Move to output_config.format
What your code does today
Sends thinking type disabled
What happens on Sonnet 5.5
400 on Sonnet 5.5
Fix
Send thinking type between_tools, the lowest setting

Behavior changes that fail quietly

Thinking is on by default. A request with no thinking field now runs adaptive thinking. Code that reads content[0].text can break because a response may start with thinking blocks, max_tokens now covers thinking plus text, and thinking tokens are billed as output.

Tool calls are no longer guaranteed. Replacing forced tool use with auto means the model can answer without calling the tool. For an agent, this is the change most likely to cause a silent regression: an answer that sounds right but skipped the lookup it depended on.

Token counts and costs move. Sonnet 5.5 uses a new tokenizer that produces about 30% more tokens for the same text than Sonnet 4.5, effort levels are recalibrated, and images can cost more at the higher resolution tier. Re-baseline cost and latency rather than assuming parity.

More requests can be declined. Sonnet 5.5 declines in more categories, returning stop_reason refusal. Handle that stop reason explicitly so a refusal is not mistaken for an empty answer.

History must be append-only. For accounts created on or after August 31, 2026, replaying a thinking block after editing earlier conversation history returns a 400 error. Agents that rewrite or trim history need to change how they do it.

A migration plan that keeps rollback possible

1. Inventory every call site. Find each request that names Sonnet 4.5 and note which of the settings above it uses. Anthropic's Claude API skill can apply the mechanical changes: in Claude Code, run /claude-api migrate with claude-sonnet-5-5 as the target, then review its checklist.

2. Freeze a baseline. Record the current prompt, tools, and model ID, and count the failure patterns you care about on recent production traffic so you have something to compare against.

3. Fix the hard errors. Work through the table above until every request succeeds on Sonnet 5.5 with no 400s.

4. Compare old and new on the same scenarios. Run real production scenarios, plus cases the agent already handles well, against both models several times each, with the prompt held constant. The regression testing guide covers what to measure. Pay special attention to tool-dependent flows now that tool use is no longer forced.

5. Tune one thing at a time. If the new model regresses, change the prompt or the effort level in small steps and re-run the same comparison. The guide to why AI agents regress after prompt or model changes covers how to isolate the cause.

6. Roll out gradually and verify on live traffic. Send part of the traffic to Sonnet 5.5 first and count the same failure patterns on both. The fix verification calculator shows whether a difference is bigger than chance.

7. Finish before the deadline. Rolling back to Sonnet 4.5 stops being possible on November 30, so leave time to fix what step 6 finds.

Illustrative example: a lookup the agent stopped making

This example is constructed to show the risk; it is not customer data. A support agent on Sonnet 4.5 forced an order-lookup tool on refund questions with tool_choice tool. On Sonnet 5.5 that request returns a 400, so the team switches to tool_choice auto with a strict tool. Every request now succeeds, and spot checks look fine.

A head-to-head run on last month's refund conversations shows the difference: on a share of them, the new configuration answers from the conversation instead of calling the lookup, and quotes the wrong order status. The fix is an explicit instruction that a lookup is required before any refund answer, verified by re-running the same scenarios and then counting the pattern on live traffic.

How Converra checks a model change

Converra supports both Claude Sonnet 4.5 and Claude Sonnet 5.5. For a model swap, it compares the old and new model at the same prompt over a seven-day window on each side and needs at least 30 scored runs per model. It marks the swap regressed if mean quality drops by more than 5 points or the failure rate rises by more than 2 percentage points, and otherwise parity verified if cost per run fell or parity without savings if it did not. If the prompt changed during the window, the result is confounded.

Before the swap, Converra can run candidate models against the same regression suite it uses for prompt changes, so the head-to-head comparison in step 4 does not have to be built by hand.

Frequently asked questions

When does Claude Sonnet 4.5 retire?

Anthropic retires claude-sonnet-4-5-20250929 on the Claude API, Claude Platform on AWS, and Microsoft Foundry on November 30, 2026, after deprecating it on September 30, 2026. Amazon Bedrock and Google Cloud set their own dates.

What should replace Claude Sonnet 4.5?

Anthropic recommends claude-sonnet-5-5. Test your agent on it before switching, because several request settings now return errors and tool use is no longer forced.

Why do I get 'This model does not support assistant message prefill'?

Claude Sonnet 5.5 rejects a prefilled last assistant turn. Replace the prefill with structured outputs or strict tools for formatting, system-prompt instructions for preambles, or a user-turn message for continuations.

Will my Sonnet 4.5 prompts work unchanged on Sonnet 5.5?

Often mostly, but not reliably. Thinking is on by default, effort is recalibrated, tool use is no longer forced, and more requests can be declined, so compare old and new on the same production scenarios before switching.

Is Claude Haiku 4.5 being retired too?

Not yet. As of October 6, 2026, Anthropic lists Claude Haiku 4.5 as active, with retirement not sooner than October 15, 2026 and no retirement date announced. Check the deprecations page for changes.

Oren Cohen, founder of Converra

Written by

Founder of Converra. Previously founded Buildup (acquired by Stanley Black & Decker) and, as VP Product Growth at Totango, owned AI end-to-end from design through production.

Know whether the new model is better before November 30

Converra replays your real scenarios on the old and new model, ships the change you approve, and checks quality and cost on live traffic: parity verified, regressed, or confounded.