What you will be able to do
- Size budget_tokens and max_tokens so that extended thinking fits within a request's output limit
- Explain how reasoning tokens from earlier turns count against the input context of a multi-turn Claude Sonnet 4.5 agent, and when to leave them out
- Choose standard, extended or reduced thinking for an agent step based on its latency, accuracy and cost requirements, and justify the choice
1.Thinking spends the output budget
Reasoning tokens are not free extras on top of the answer. They come out of the same output limit. The documented extended-thinking request for databricks-claude-sonnet-4-5 gives thinking a budget of 10,240 tokens inside an overall max_tokens of 20,480:
response = client.chat.completions.create(
model="system.ai.claude-sonnet-4-5",
messages=[{"role": "user", "content": "Why is the sky blue?"}],
max_tokens=20480,
extra_body={
"thinking": {
"type": "enabled",
"budget_tokens": 10240
}
}
)Two hard rules come with this. First, budget_tokens must be less than max_tokens. A thinking budget at or above the output limit is invalid, so the predict above describes a request you need to fix. Second, bigger budgets give diminishing and less predictable returns: "Higher budgets can improve quality for complex tasks, but usage above 32K may vary." The Responses API states the same accounting directly. Its max_output_tokens is an upper bound on generated tokens "including visible output tokens and reasoning tokens". Every token you give to thinking is a token the final answer can no longer use.
Checkpoint 1 of 3· Check yourself
An agent step on databricks-claude-sonnet-4-6 must return a long structured answer and also reason carefully. Which configuration is valid and leaves room for the answer?
budget_tokens must be strictly less than max_tokens. 20,480 with 10,240 for thinking leaves output room for the answer. Equal or inverted values break that rule.
“budget_tokens must be less than max_tokens.”Source: docs.databricks.com
2.Reasoning tokens in a multi-turn context window
In an agent loop, the question changes from "how much does this call cost?" to "what does this call leave behind in the context?" For databricks-claude-sonnet-4-5 the documentation answers it ("This section is specific to the databricks-claude-sonnet-4-5 model."): only the reasoning blocks associated with the last assistant turn or tool-use session are visible to the model and counted as input tokens. Thinking from earlier turns does not keep piling up as input. The most recent turn's reasoning does, so a large extended-thinking budget on the latest turn makes the next request's input larger.
You can also choose not to send that reasoning back. If the next step does not need the model to reason over its previous steps, you can omit the reasoning block entirely. That keeps those tokens out of the input context. Don't assume other models behave the same way. The documentation scopes this rule to Sonnet 4.5.
Checkpoint 2 of 3· Check yourself
A ten-turn tool-calling agent on databricks-claude-sonnet-4-5 uses extended thinking on every turn. Which reasoning tokens count as input on turn eleven?
For Sonnet 4.5, only the latest turn's or tool-use session's reasoning blocks are visible and billed as input, and you can drop even those by leaving out the reasoning block.
“only the reasoning blocks associated with the last assistant turn or tool-use session are visible to the model and counted as input tokens”Source: docs.databricks.com
Sources1
3.Choosing and justifying a mode for an agent task
A sound justification has three parts: what the task needs, what setting delivers it, and what that setting costs in tokens and context. Hybrid Sonnet models are aimed at work that needs "a balance of practical throughput and advanced thinking such as customer-facing agents". In practice that means fast replies by default and thinking only on the hard steps. Claude Fable 5.1, built for long-running work, "supports per-turn effort controls and thinking updates between tool calls for sustained, complex workflows", so effort can change from step to step instead of being fixed for the whole agent.
| Agent requirement | Mode and setting | Token / context justification |
|---|---|---|
| Lowest latency on a simple step (Gemini 3) | Standard: reasoning_effort "minimal" | Requests that use "minimal" return no reasoning tokens |
| Fast routine replies on a reasoning-only model (Opus 5.5) | Reduced: output_config.effort low | Thinking cannot be disabled, so low is the cheapest setting |
| Long-context, cost-sensitive analysis (Opus 5) | Reduced: low or medium effort | Near-top quality without spending output tokens on maximum reasoning |
| Hard multi-step reasoning on a hybrid Claude model | Extended: thinking budget_tokens below max_tokens | Budget comes out of output; above 32K, usage may vary |
| Multi-turn agent on databricks-claude-sonnet-4-5 | Extended thinking, reasoning block omitted when not needed | Last turn's reasoning counts as input tokens |
Checkpoint 3 of 3· Check yourself
A customer-facing triage step on databricks-gemini-3-1-pro must respond as fast as possible and does not need multi-step reasoning. Which setting best fits, and why?
On Gemini 3, "minimal" gives the fastest, lowest-latency responses with no reasoning tokens. Leaving the parameter out gives the default of "low", which still reasons.
“Requests that use "minimal" return no reasoning tokens.”Source: docs.databricks.com
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.budget_tokens is a separate allowance on top of max_tokens, so you can set it as high as you like.Why is that wrong?
Thinking uses up the output allowance. budget_tokens must be strictly less than max_tokens, and budgets above 32K behave less predictably.
Covered in Thinking spends the output budget
2.With extended thinking, reasoning from every earlier turn piles up in the input context of a multi-turn agent.Why is that wrong?
For databricks-claude-sonnet-4-5, only the last assistant turn's or tool-use session's reasoning counts as input, and you can leave even that out.
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“budget_tokens must be less than max_tokens.”
↩︎ Thinking spends the output budget“This section is specific to the databricks-claude-sonnet-4-5 model.”
↩︎ Reasoning tokens in a multi-turn context window“only the reasoning blocks associated with the last assistant turn or tool-use session are visible to the model and counted as input tokens”
↩︎ Reasoning tokens in a multi-turn context window“Use "minimal" to skip reasoning for the fastest, lowest-latency responses.”
↩︎ Choosing and justifying a mode for an agent task“Higher budgets can improve quality for complex tasks, but usage above 32K may vary.”
↩︎ Exam trap 1“you can omit the reasoning block entirely”
↩︎ Exam trap 2“Requests that use "minimal" return no reasoning tokens.”
↩︎ Checkpoint - 2.https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/api-referenceOfficial docs
“including visible output tokens and reasoning tokens”
↩︎ Thinking spends the output budget - 3.https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/supported-modelsOfficial docs
“specializes in applications that require a balance of practical throughput and advanced thinking such as customer-facing agents”
↩︎ Choosing and justifying a mode for an agent task“supports per-turn effort controls and thinking updates between tool calls for sustained, complex workflows”
↩︎ Choosing and justifying a mode for an agent task“it delivers near-top quality at low and medium reasoning effort, making it well suited for long-context, cost-sensitive enterprise workflows”
↩︎ Prediction