Urgent.News

What's breaking now, across hundreds of outlets.

AI

Moving from Claude Sonnet 4.5 to 5.5? budget_tokens returns a 400. Change the request, not just the ID.

Don't only swap the ID: Sonnet 5.5 rejects your budget_tokens. claude-sonnet-4-5-20250929 shuts down on November 30, 2026 , and Anthropic's replacement is claude-sonnet-5-5 . If your code uses extended thinking, the swap is more than a rename. What changes On Sonnet 4.5, extended thinking took a token budget: client . messages . create ( model = "claude-sonnet-4-5-20250929" , max_tokens = 16000 ,…

Moving from Claude Sonnet 4.5 to version 5.5 requires more than just changing the model ID—it demands a careful review of all instances where budget_tokens are used. On Sonnet 4.5, the thinking parameter could specify a token budget for extended thinking, which was enabled with a budget of 8,000 tokens. However, this approach is no longer compatible with Sonnet 5.5, which rejected the budget_tokens parameter with a 400 error code.

The key change lies in adapting the thinking strategy from explicitly budgeted tokens to the adaptive mode, where the model determines its own level of thinking based on the task at hand. This requires updating the code from `thinking: { "type": "enabled", "budget_tokens": 8000 }` to `thinking: { "type": "adaptive" }`. This adjustment is crucial because even if tests pass by mocking the client and avoiding real calls, the switch to the updated model can lead to variations in output, such as changes in response length, formatting, refusal patterns, or the use of tooling.

It's imperative to conduct a thorough search for any occurrences of budget_tokens in all relevant files, including shared client wrappers and configuration settings, to ensure a comprehensive transition. After making these changes, it's advisable to send a real request from the deployed application to verify that the updated logic works as intended before considering the deployment complete.

Additionally, it's not just about renaming the model ID; it's about ensuring the new model behaves as expected in terms of output quality and functionality.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in AI

More from Wednesday 25 November →