Anthropic calls Sonnet 5 a drop-in upgrade from Sonnet 4.6, but the request contract and runtime behavior contain changes that can break existing integrations. Manual thinking budgets and non-default sampling parameters now return errors. Adaptive thinking is on by default. A new tokenizer changes token counts and therefore budgets.
A production migration should be treated as a versioned release with replay evaluation, staged traffic, monitoring, and rollback, not a one-line configuration change.
Source note: This guide follows Anthropic's official What's new in Claude Sonnet 5 documentation, reviewed July 11, 2026.
Sonnet 4.6 to Sonnet 5 change summary
| Area | Sonnet 4.6 | Sonnet 5 action |
|---|---|---|
| Model ID | claude-sonnet-4-6 | Use claude-sonnet-5 |
| Thinking default | No thinking when field omitted | Adaptive thinking runs by default; disable explicitly when justified |
| Manual thinking | Deprecated | Removed; manual budget returns HTTP 400 |
| Sampling | Custom parameters accepted in prior patterns | Non-default temperature, top_p, or top_k returns HTTP 400 |
| Tokenizer | Previous tokenizer | New tokenizer can produce more tokens for the same text |
| Context / output | 1M beta context | 1M default context and 128k max output |
| Pricing | $3 / $15 per MTok | $2 / $10 introductory through Aug. 31; then $3 / $15 announced |
1. Inventory every request path
Find model IDs in application configuration, SDK wrappers, background jobs, evaluation tools, fallback lists, agent definitions, prompt-management systems, and cloud-provider deployments. Search for thinking fields and sampling parameters, not only the old model name.
Record each workload owner, traffic volume, data classification, tools, response schema, latency target, current token distribution, and rollback mechanism. A migration cannot be safely staged when the inventory is incomplete.
2. Update incompatible request parameters
Replace the model ID with claude-sonnet-5. Remove thinking: {type: "enabled", budget_tokens: ...}. Use adaptive thinking and control depth with the effort setting. Remove non-default temperature, top_p, and top_k; use system instructions to shape behavior.
If a workload should not use thinking, pass the supported disabled setting explicitly and verify quality. Do not assume omission preserves Sonnet 4.6 behavior: on Sonnet 5, omission enables adaptive thinking.
3. Recount tokens and revisit limits
Anthropic states that the new tokenizer can map the same text to more tokens and recommends recounting prompts. This affects input spend, context thresholds, rate limits, cache boundaries, chunk sizes, and maximum output planning.
Measure actual production-shaped inputs, not only a few short prompts. Retrieved documents, tool results, code, and structured data can tokenize differently. Ensure max_tokens leaves enough room for thinking plus the visible response because it is a hard total output limit.
4. Replay the evaluation suite
Compare accepted completion, structured-output validity, tool selection, argument correctness, step count, stop reasons, refusals, latency, input, output, and human correction. Include cases where Sonnet 4.6 failed as well as cases it handled reliably.
Version prompts and tool schemas with the model. If you change prompts during the migration, keep a separate baseline so the team can distinguish model effects from prompt effects.
5. Stage traffic and preserve rollback
- Run offline replay against stored, appropriately governed cases.
- Shadow a portion of live traffic without using the candidate output.
- Canary a small percentage of eligible production requests.
- Compare service-level and evaluation metrics against the Sonnet 4.6 control.
- Increase traffic only after the acceptance thresholds hold.
- Keep the old model, prompts, and routing configuration deployable until the rollback window closes.
6. Reforecast cost
Introductory pricing can hide the future steady-state budget. Forecast both the current $2/$10 rate and the announced $3/$15 standard rate after August 31, 2026. Incorporate tokenizer changes, thinking output, retries, cache behavior, and traffic growth.
Use the cost calculator for a base comparison, then replace assumptions with measured usage.
Migration acceptance checklist
- No production request sends removed thinking or sampling parameters.
- Token budgets, rate limits, and max output settings use Sonnet 5 measurements.
- Representative evaluation quality meets or exceeds the approved baseline.
- Tool calls, structured output, and stop reasons are handled correctly.
- Latency and cost are within both introductory and standard-price budgets.
- Monitoring distinguishes model version and prompt version.
- Rollback has been tested, not merely documented.
Frequently asked questions
Is Claude Sonnet 5 a drop-in replacement for Sonnet 4.6?
Anthropic describes it as a drop-in upgrade, but integrations must review behavior changes. Sonnet 5 uses adaptive thinking by default, rejects manual thinking budgets and non-default sampling parameters, and uses a new tokenizer that can increase token counts.
What is the Claude Sonnet 5 API model ID?
The Claude API model ID is claude-sonnet-5.
Why can Sonnet 5 return a 400 error after migration?
It returns a 400 when a request uses manual extended-thinking budgets or sets temperature, top_p, or top_k to non-default values. Remove those parameters and use adaptive thinking, effort, and prompt instructions.
Does Sonnet 5 use more tokens than Sonnet 4.6?
The same text can map to more tokens because Sonnet 5 uses a new tokenizer. Anthropic advises measuring prompts again and reports approximately 30% more tokens as a planning reference, with variation by content.
How should I test a Sonnet 5 migration?
Replay representative production cases and compare accepted output, token counts, latency, tool behavior, stop reasons, refusals, structured-output validity, and cost. Use a staged rollout with versioned prompts, monitoring, and a tested rollback.
Migration affects more than the model ID. Datrick can inventory request paths, build replay evaluation, stage the rollout, and document rollback and handover.
Scope a Sonnet 5 migration