Claude Opus 4.7 (Anthropic’s most capable reasoning model as of March 2026) launched task budgets in public beta on March 13, 2026 — a new API parameter that places a hard token ceiling on an entire agentic loop, covering thinking, tool calls, tool results, and final output combined. The model sees a live countdown and wraps gracefully as the budget is consumed.
This is the direct response to one of the loudest complaints about Anthropic’s Claude agent infrastructure: unpredictable, runaway token consumption on complex tasks. Task budgets give developers a dial they have been asking for since Claude Code shipped.
What Claude Opus 4.7 Task Budgets Actually Do
Task budgets don’t limit individual API responses. They cap cumulative token consumption across a complete agentic session — the kind that chains dozens of tool calls, intermediate reasoning steps, and result processing before producing a final answer.
Without a budget, a complex coding agent can consume 50,000 to 200,000 tokens on a single debugging task. With output_config.task_budget set, the model adjusts reasoning depth in real time, compressing or skipping non-essential thinking as the ceiling approaches. The model doesn’t hard-stop at the limit — it wraps cleanly with whatever progress has been made.
The practical result is predictable per-task spend. A budget of 10,000 tokens produces a bounded cost regardless of how complex the underlying problem turns out to be. Teams building AI coding agents, research assistants, or multi-step automation pipelines can now set a hard maximum spend per task and enforce it.
The API: Two Changes to Every Agentic Call
Activating task budgets requires two additions to your API call: the task-budgets-2026-03-13 beta header and the output_config.task_budget parameter. The value is a token count applying to the full agentic session, not an individual completion.
import anthropic
client = anthropic.Anthropic()
response = client.beta.messages.create(
model="claude-opus-4-7-20260313",
max_tokens=16000,
betas=["task-budgets-2026-03-13"],
output_config={
"task_budget": 10000 # token ceiling for entire agentic loop
},
tools=[search_tool, code_execution_tool],
messages=[
{"role": "user", "content": "Audit this codebase for security vulnerabilities"}
]
) For TypeScript environments:
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic();
const response = await client.beta.messages.create({
model: 'claude-opus-4-7-20260313',
max_tokens: 16000,
betas: ['task-budgets-2026-03-13'],
output_config: {
task_budget: 10000
},
tools: [searchTool, codeExecutionTool],
messages: [
{ role: 'user', content: 'Audit this codebase for security vulnerabilities' }
]
}); Budget sizing by task type:
- 5,000 tokens — Quick lookups, single-file analysis, simple Q&A
- 10,000–20,000 tokens — Multi-file reviews, moderate debugging sessions
- 50,000+ tokens — Complex refactors, cross-repository analysis, research synthesis
The API response metadata includes budget consumption figures, enabling per-task cost logging against actual output quality — the instrumentation data you need to optimize budgets over time.
Adaptive Thinking Replaces Extended Thinking: A Breaking Change
Extended thinking — introduced with Claude 3.7 Sonnet and carried through Opus 4.6 — is deprecated in Opus 4.7. The budget_tokens parameter inside the thinking block now returns a 400 error. Any production code using extended thinking must migrate before deploying Opus 4.7.
Adaptive thinking is the replacement. Instead of developers specifying a fixed thinking token budget, the model determines reasoning depth dynamically based on task complexity. Simple questions trigger minimal chain-of-thought; complex debugging triggers extended reasoning automatically. The developer loses one configuration lever but gains a model that doesn’t under-think hard problems when constrained by a small thinking budget.
# Opus 4.6 pattern — returns 400 error on Opus 4.7. Do not use.
response = client.messages.create(
model="claude-opus-4-6-20251201",
max_tokens=16000,
thinking={
"type": "enabled",
"budget_tokens": 10000 # DEPRECATED — causes 400 in Opus 4.7
},
...
)
# Opus 4.7 pattern — move all spend control to task_budget
response = client.beta.messages.create(
model="claude-opus-4-7-20260313",
max_tokens=16000,
betas=["task-budgets-2026-03-13"],
output_config={
"task_budget": 10000
},
...
) The migration is straightforward: remove the thinking block entirely, add the beta header, and shift spend control to output_config.task_budget. Teams running extended thinking in production at any scale should treat this as a P0 migration item before any Opus 4.7 rollout.
The Hex Benchmark: Effort Equivalence Between Opus 4.6 and 4.7
Hex, the collaborative data analytics platform, published benchmark findings showing that low-effort Opus 4.7 is roughly equivalent in output quality to medium-effort Opus 4.6. This single data point changes the cost math for every team currently running Opus 4.6 at medium thinking budgets.
The underlying reason is that Opus 4.7’s native capability ceiling is higher. Reasoning that Opus 4.6 required extended thinking to reach, Opus 4.7 reaches with adaptive thinking at lower token cost. The model is smarter at the base layer, so less explicit reasoning overhead is required to produce equivalent outputs.
The direct implication: teams that migrate to Opus 4.7 and apply identical token budgets to Opus 4.6 will overspend relative to the quality they actually need. The right starting point is 50–60% of your current Opus 4.6 task budget, measured against output quality, with incremental increases only where degradation is observed.
| Opus 4.7 effort level | Approximate Opus 4.6 equivalent | Practical use case |
|---|---|---|
| Low (per Hex benchmarks) | Medium extended thinking | Standard coding tasks, reviews, Q&A |
| Medium | High extended thinking | Complex debugging, multi-file analysis |
| High | Max extended thinking budget | Research synthesis, architecture decisions |
Hex published the low-effort equivalence directly; medium and high mappings are extrapolated from the model capability delta.
Batch API Now Supports 300,000 Output Tokens
The Anthropic Batch API received a separate update alongside Opus 4.7: maximum output tokens per batch request increased to 300,000. The change directly benefits bulk processing workloads — large-scale document analysis, multi-file code review, data extraction pipelines — where previous output ceilings created artificial truncation or forced task splitting.
300,000 output tokens is sufficient to produce full code files, comprehensive analytical reports, or large structured JSON extractions from bulk inputs within a single batch call. Developers who built split-and-merge pipeline logic to work around output limits can simplify their architectures.
Combined with task budgets on the agentic inference side, the Batch API ceiling increase gives teams more configurability at both ends of Anthropic’s stack. The competitive dynamics in the AI API market are driving Anthropic to address developer pain points in accelerated succession — both updates ship within the same beta window.
Agentic Coding Economics After Task Budgets
The burn-rate problem in AI coding agents has two components: cost per token (a pricing lever developers don’t control) and tokens consumed per task (now controllable). Task budgets address the second component directly.
The recommended deployment workflow for teams moving Opus 4.7 onto production coding workloads:
- Set an initial task budget at 5,000–10,000 tokens for your standard task type
- Log actual consumption and output quality across 50–100 tasks before adjusting
- Identify the quality cliff — the budget level below which output degrades past threshold
- Set production budgets at 20% above the quality cliff for headroom
- Apply elevated budgets only to task categories that demonstrably require more reasoning depth
This is standard cost optimization methodology for any variable-cost API. What was missing until now was the mechanism to enforce it — there was no reliable per-loop cap on Claude’s agentic stack. As agentic AI systems move into production environments at scale, predictable unit economics become a prerequisite for deployment, not an afterthought.
MegaOne AI tracks 139+ AI tools across 17 categories. Hard cost ceilings per agentic task are now an evaluation criterion when assessing frontier model APIs for production coding applications — Anthropic is the first major provider to ship this capability at the inference loop level rather than at the account or rate-limit tier.
Task budgets are in beta as of April 2026. Activate via the task-budgets-2026-03-13 beta header, instrument consumption logging from the first deployment, and validate output quality against your Opus 4.6 baseline before committing production budgets. The teams with granular consumption data will optimize spend significantly faster when the feature reaches general availability.