budget_tokens returns 400 on newer Claude models: move to adaptive
From Claude 4.7 on, a request with thinking type enabled and budget_tokens gets a 400 error. Remove the budget, set type: adaptive, and control depth with effort.

One line in the request, budget_tokens, used to be enough to give Claude time to think before answering. The same line now fails the whole request with a 400 error as soon as you switch the model name to a newer one. By the end of this article you will know what changed, which models are affected, and how to move your code with a small edit, knowing that the first request after it misses the cache once.
What is extended thinking, and what changed?
Extended thinking is a Messages API mode where you set a fixed token budget for Claude's thinking before its answer, with thinking: {type: "enabled", budget_tokens: N}. That mode is now legacy, and the newer models reject it.
It is like giving an employee exactly one hour for every task, easy or hard. According to the extended thinking page in the Claude documentation, the mode is deprecated, and Claude 4.7 and later models do not support it and return a 400 error. The same page says the budget must be at least 1,024 tokens and less than max_tokens.
Why might your code stop working suddenly?
Your code stops because you changed nothing but the model name, and the old line stayed in the request. The whole request returns a 400 error, not a weaker answer.
The mistake usually goes like this: you have one function that builds every request, and it has carried budget_tokens for a year. You read that a newer model is out, swap its name in the config file, and deploy. Nothing in the code is broken, but the request now has a shape the model no longer accepts.
The documentation splits the models into three groups:
Models | Extended thinking ( | Adaptive thinking ( |
|---|---|---|
Claude Opus 4.5, Sonnet 4.5 and Haiku 4.5 | The only mode | 400 error |
Claude Opus 4.6 and Sonnet 4.6 | Works but deprecated | Supported |
Claude 4.7 and later, such as Opus 5.5 and Haiku 5.5 | 400 error | Supported |
How do you move the request to adaptive thinking?
You move it with three edits: remove budget_tokens, set type: "adaptive", and control thinking depth with output_config.effort instead of a budget.
Before:
{
"model": "claude-sonnet-4-6",
"max_tokens": 16000,
"thinking": {
"type": "enabled",
"budget_tokens": 10000
}
}After:
{
"model": "claude-sonnet-4-6",
"max_tokens": 16000,
"thinking": {
"type": "adaptive"
},
"output_config": {
"effort": "high"
}
}The default effort on Claude Sonnet 4.6 is high, so that line is only there to show where the setting lives. Claude Opus 5.5 and Claude Haiku 5.5 default to medium, so if you want the same depth as before, write it out.
What changes in Claude's behavior after the move?
Adaptive thinking lets Claude decide whether and how much to think on each request, instead of always thinking at the start of each turn. At a low effort, it might skip thinking entirely on an easy question.
Two things affect your bill:
The first request after the switch misses the cache, because changing the thinking mode invalidates cache breakpoints. Make the switch once and keep it.
Watch
usage.output_tokens_details.thinking_tokensin the response: it tells you how many of your billed output tokens were thinking.
Where do you start now?
The lesson for us as developers: a fixed setting in your request is part of your contract with the model, and the contract changes with every generation. So when you change the model name, read the page for the mode you use before you deploy.
Search your code for budget_tokens now, and check which model each request goes to. If the model is 4.7 or newer, move it with the edit above. Then review prompt caching in the Claude API, since the switch clears it once, and handling Claude API errors so a 400 doesn't get lost among retryable errors, and counting tokens before a request if you want to estimate cost. And if you build with Claude Code, see AI skills. How many of your requests still carry budget_tokens?
FAQ
If I still use Claude Sonnet 4.5, do I have to change now?
No. The 4.5 models support only extended thinking, and the documentation says adaptive returns a 400 error on them. Keep budget_tokens until you move to a model that supports adaptive thinking.
Can adaptive thinking skip thinking entirely?
Yes. The documentation says Claude decides whether and how much to think on each request, and at lower effort it might skip thinking on easy inputs.
How do I see what thinking cost me?
From the usage.output_tokens_details.thinking_tokens field in the response. It reports how many of the billed output tokens were thinking.


