Claude Adaptive Thinking vs budget_tokens
Adaptive thinking vs budget_tokens on Claude 4.6 / 4.7 / 4.8: set thinking to adaptive, tune effort, and why Opus 4.8 returns a 400 error for budget_tokens.
Need an API key? Sign up →Endpoints & base URLs →
On This Page
- Key Differences vs. Legacy Extended Thinking
- Model Support Matrix
- The effort Parameter: A Coarse Knob for Reasoning Depth
- API Usage Examples
- Rendering Thinking Content
- Task Budgets (Beta)
- Cost Observability Tips
- FAQ
- How do I convert from budget_tokens to adaptive thinking?
- My request to Opus 4.7 / 4.8 / a 5-series model returns 400 saying budget_tokens is not allowed
- Should I keep using budget_tokens on Sonnet 4.6?
- I want to turn thinking off and Opus 5.5 returns 400. What now?
- How do I change effort in the Claude Code CLI?
- Next Steps
Adaptive Thinking is the reasoning mode introduced with Claude 4.6: the model itself decides when to invest in reasoning and how many tokens to spend, with no fixed budget set up front by the developer. The effort parameter offers coarse-grained control over reasoning depth. This guide covers the related API usage, the model support matrix, and the quality vs. cost trade-offs.
Where the parameters come from: the rows below follow Anthropic's official documentation as of 2026-10-15. The 4.x models were previously tested as callable on QCode; the 5-series models have not yet been verified item by item on QCode. For 5-series model choice see Model Selection.
Key Differences vs. Legacy Extended Thinking¶
| Dimension | Legacy Extended Thinking (4.5 and earlier) | Adaptive Thinking (4.6 and later) |
|---|---|---|
| Trigger parameter | thinking={"type": "enabled", "budget_tokens": N} |
thinking={"type": "adaptive"} |
| Budget control | Fixed token cap (budget_tokens must be < max_tokens) |
Model self-regulates, optionally tuned by effort |
| Cross-tool-call behavior | Not interleaved by default (requires the interleaved-thinking-2025-05-14 beta header) |
Interleaved automatically (no beta header needed) |
| Opus 4.7 and later (including 4.8 and the 5 family) | ❌ 400 error (budget_tokens is no longer supported) |
✅ The only supported mode |
| Sonnet 4.6 / Opus 4.6 | ⚠️ deprecated (still works but not recommended) | ✅ Recommended |
Short rule: use adaptive for 4.6 and later models; only use budget_tokens for 4.5 and earlier (those older models return 400 for type: "adaptive").
Model Support Matrix¶
| Model | Adaptive thinking | budget_tokens | effort parameter |
|---|---|---|---|
claude-opus-5-5 |
✅ On by default and cannot be turned off (thinking: {"type": "disabled"} returns 400) |
❌ 400 error | ✅ low / medium / high / xhigh / max, default medium |
claude-sonnet-5-5 |
✅ On by default; thinking: {"type": "between_tools"} turns off up-front thinking (low / medium / high only) |
❌ 400 error | ✅ low / medium / high / xhigh / max, API default high |
claude-haiku-5-5 |
✅ On by default; thinking: {"type": "disabled"} turns it off (high effort or below only) |
❌ 400 error | ✅ low / medium / high / xhigh / max, default medium |
claude-opus-5 |
✅ On by default; disabled works at high effort or below |
❌ 400 error | ✅ low / medium / high / xhigh / max, default high |
claude-sonnet-5 |
✅ On by default; disabled works |
❌ 400 error | ✅ low / medium / high / xhigh / max, default high |
claude-opus-4-8 |
✅ Only way to enable (no thinking field means no thinking) |
❌ 400 error | ✅ low / medium / high / xhigh / max |
claude-opus-4-7 |
✅ Only way to enable | ❌ 400 error | ✅ low / medium / high / xhigh / max |
claude-sonnet-4-6 |
✅ Recommended | ⚠️ Still works but deprecated | ✅ low / medium / high / max |
claude-haiku-4-5-20251001 |
❌ type: "adaptive" returns 400 |
✅ Use this | ❌ effort parameter will error |
claude-sonnet-4-5 and earlier |
❌ Not supported | ✅ Use this | ❌ |
The 4.x models above were previously tested as callable on QCode; for the 5 family the parameter behaviour follows the official docs. Per-model rates and availability are on qcode.cc/models.
The effort Parameter: A Coarse Knob for Reasoning Depth¶
effort controls the overall intensity of adaptive thinking (covering thinking tokens, tool-call count, and answer thoroughness). In a request it is written as output_config.effort.
| effort | Best for | Notes |
|---|---|---|
low |
Simple Q&A, sub-agents, latency-sensitive paths | Cheapest in tokens; simple tasks may skip thinking entirely |
medium |
Routine coding, doc lookup (most everyday tasks) | Default for Opus 5.5 and Haiku 5.5 |
high |
Complex reasoning, multi-file refactoring | Default for most models |
xhigh |
Long-horizon agent workflows (available from Opus 4.7, Sonnet 5 and Haiku 5.5) | Thinks more readily and deeper than high |
max |
Maximum quality, cost is secondary | No constraint on thinking length |
Rule of thumb: Opus 5.5 and Haiku 5.5 default to medium, and Sonnet 5.5 defaults to high on the API; Anthropic advises re-running your own evals after switching models instead of carrying settings over. xhigh offers the best price-performance for long agent loops (e.g., multi-step code review, deep research); max is worth it only when correctness is far more important than cost. When you raise the level, raise max_tokens too, because thinking tokens count toward the output cap.
Changing effort invalidates the prompt cache: to keep hitting the cache, keep the thinking configuration and effort constant within a conversation. To vary it mid-conversation, use the official per-message effort change (beta, requires the beta header mid-conversation-output-config-2026-07-01; supported on Opus 5.5, Sonnet 5.5, Haiku 5.5 and others).
API Usage Examples¶
Python (anthropic SDK)¶
import anthropic
client = anthropic.Anthropic(
base_url="https://api.qcode.cc/api",
api_key="cr_xxxxxxxx",
)
response = client.messages.create(
model="claude-opus-5-5",
max_tokens=16000,
thinking={"type": "adaptive"},
output_config={"effort": "high"},
messages=[{"role": "user", "content": "Refactor the authentication logic of the user service module..."}],
)
for block in response.content:
if block.type == "thinking":
print(f"[Thinking] {block.thinking}")
elif block.type == "text":
print(f"[Answer] {block.text}")
TypeScript (@anthropic-ai/sdk)¶
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.qcode.cc/api",
apiKey: "cr_xxxxxxxx",
});
const response = await client.messages.create({
model: "claude-opus-5-5",
max_tokens: 16000,
thinking: { type: "adaptive" },
output_config: { effort: "high" },
messages: [{ role: "user", content: "Refactor user service..." }],
});
Claude Code CLI¶
In Claude Code, adjust effort with /effort: with no argument it opens a slider, /effort high sets a level directly, and /effort auto clears the saved level. You can also pass --effort at launch or set the environment variable CLAUDE_CODE_EFFORT_LEVEL. The current level is shown in the session header next to the model name. Selectable levels: low, medium, high, xhigh and max on Opus 5.5 / Sonnet 5.5 / Haiku 5.5 / Opus 5 / Sonnet 5 / Opus 4.8 / Opus 4.7; low, medium, high and max on Opus 4.6 and Sonnet 4.6.
Claude Code defaults (official docs, as of 2026-10-15): medium on Opus 5.5, Sonnet 5.5 and Haiku 5.5, xhigh on Opus 4.7, and high on the other models that support effort. In Claude Code, thinking cannot be turned off on these three 5.5 models; to get less thinking, lower the effort.
Rendering Thinking Content¶
5-series models (including Opus 5.5, Sonnet 5.5 and Haiku 5.5) do not display thinking text by default (display defaults to "omitted"); reasoning is internal-only, and thinking tokens are still billed as usual. To surface the thinking trace in your UI:
thinking={"type": "adaptive", "display": "summarized"}
display: "summarized" tells the model to emit a thinking summary (visible thinking blocks); omitted only counts thinking tokens without producing visible text.
Task Budgets (Beta)¶
If you are running an agent loop and want a global cap for the whole turn (covering thinking + tools + final output), use task_budget. The official docs list Opus 5.5, Sonnet 5.5, Haiku 5.5, Opus 5, Opus 4.8, Opus 4.7 and others as beta-supported; Sonnet 5 is not supported:
response = client.beta.messages.create(
betas=["task-budgets-2026-03-13"],
model="claude-opus-5-5",
max_tokens=64000,
thinking={"type": "adaptive"},
output_config={
"effort": "high",
"task_budget": {"type": "tokens", "total": 128000},
},
messages=[...],
)
The model sees a countdown of the remaining budget and self-regulates to avoid overshoot. The minimum total is 20,000; smaller values return 400.
Cost Observability Tips¶
Once adaptive thinking is enabled, both input and output tokens trend higher; monitor accordingly:
print(response.usage)
# Watch: input_tokens, output_tokens, cache_read_input_tokens
# Adaptive thinking does not bill thinking tokens separately — they are billed as output tokens and roll into output_tokens
QCode bills per token; per-model rates are on qcode.cc/models. Requests are reported to probe.qcode.cc, where you can see the input / output / thinking ratio per request.
FAQ¶
How do I convert from budget_tokens to adaptive thinking?¶
There is no linear conversion. budget_tokens=8000 does not map to a particular effort level. Start with effort: "medium" and tune based on answer quality and token usage. If you must enforce a hard cap, use task_budget (see above).
My request to Opus 4.7 / 4.8 / a 5-series model returns 400 saying budget_tokens is not allowed¶
Replace every thinking={"type": "enabled", "budget_tokens": N} with thinking={"type": "adaptive"}. Opus 4.7 and later no longer support budget_tokens (any value returns 400).
Should I keep using budget_tokens on Sonnet 4.6?¶
Not recommended. Use adaptive thinking for all new code. budget_tokens still works on 4.6 but is on a deprecated path.
I want to turn thinking off and Opus 5.5 returns 400. What now?¶
Thinking cannot be turned off on Opus 5.5. To make it think less, lower the effort (for example low). Use thinking: {"type": "between_tools"} on Sonnet 5.5 and thinking: {"type": "disabled"} on Haiku 5.5; both work only at high effort or below.
How do I change effort in the Claude Code CLI?¶
Use /effort (see above) or add --effort at launch; the persisted default lives under effortLevel or the per-model modelSettings in ~/.claude/settings.json.
Next Steps¶
- Model Selection Guide — pricing and capability comparison across models
- Best Practices — prompting techniques for large contexts and agent workflows
- Endpoints and API Paths — full reference for QCode.cc's ingress domains
- Claude Code Tutorial — full CLI feature reference
Get started with QCode
One API key for Claude Code, Codex and more — billed per token, per-model prices on qcode.cc/models