AI & Machine Learning

Claude Opus 5 for long-running agents: the cost math

By Technspire TeamJuly 27, 20264 views

Anthropic released Claude Opus 5 on 24 July 2026, priced at \$5 per million input tokens and \$25 per million output tokens, unchanged from Opus 4.8. The model ships with a 1M-token context window, 128K output tokens, adaptive thinking on by default, and a positioning statement aimed squarely at agent builders: a step-change improvement for long-running agents, agentic coding and professional work. It landed in Microsoft Foundry the same day, which makes it directly consumable from an Azure subscription. For Swedish and EU teams running agents on Azure, the interesting question is not whether Opus 5 is good. Anthropic's own benchmarks say it approaches Claude Fable 5 at half the price. The interesting question is when a \$5/\$25 model beats a \$2/\$10 model on total cost, because for long-running agent workloads the per-token price is the wrong unit of account.

What Anthropic shipped on 24 July

Specs and pricing

The published specifications: 1M-token context window, 128K max output (300K on the Batch API with a beta header), text and image input, a May 2026 knowledge cutoff, and a retirement commitment of no sooner than 24 July 2027. Pricing is \$5/\$25 per million tokens, with prompt-cache reads at \$0.50 per million (10% of base input), 5-minute cache writes at \$6.25, and a 50% batch discount. A fast mode is available as a research preview at twice the base price for roughly 2.5x the speed. The model is live on the Claude API, Amazon Bedrock, Google Cloud Vertex AI and Microsoft Foundry from day one.

Anthropic's launch claims are worth quoting precisely, because the framing is economic rather than absolute. The company reports Opus 5 more than doubles Opus 4.8's score on Frontier-Bench, comes within 0.5% of Fable 5 on CursorBench 3.2 at maximum effort at half the cost, achieves 1.5x Opus 4.8's pass rate on Zapier's AutomationBench for the same spend, and matches Fable-class results on OSWorld 2.0 at a third of the cost. Every headline claim is a cost-per-outcome claim. That tells you how Anthropic expects this model to be judged, and it is the right frame for agent workloads.

Adaptive thinking and effort: two breaking changes

Teams migrating from Opus 4.8 should note two behavioural changes. Thinking is now on by default, and it can only be disabled at effort high or below. The effort parameter (defaulting to high) is the main cost-tuning knob: lower effort spends fewer thinking tokens, higher effort buys more deliberation on hard steps. Since output tokens cost \$25 per million, effort tuning is not cosmetic. An agent that thinks aggressively on every trivial tool call burns budget for nothing, so profile your traces per task type before settling on a default. TechCrunch also reported an automatic-fallbacks beta on the API, which routes requests to a smaller model instead of returning errors when safety filters trigger. For unattended agents, a degraded answer you can detect beats a hard failure at 03:00.

Per-token price is the wrong unit for agents

A chatbot answers a question and the transaction ends. An agent runs a loop: plan, call tools, read results, verify, retry, continue for minutes or hours. Two things follow from that shape. First, token volume per task is large and dominated by input re-reads, which is why cache pricing matters more than base input pricing. Second, and more important, runs can fail. A failed run costs the full token bill plus whatever it costs your organisation to notice, diagnose and redo the work. That second term usually dwarfs the first.

The metric that matters is cost per completed task, not cost per million tokens:

cost_per_completed_task =
    (model cost per run / unattended success rate)
  + (escalation rate x cost of human intervention)

where escalation rate = share of runs a person must rescue

The first term amortises retries. The second prices the engineer who gets pulled off other work to untangle a half-finished migration or a wrongly filed batch of invoices. In Sweden, a senior engineer's loaded cost sits around 900 to 1,200 SEK per hour, so thirty minutes of rescue work costs roughly 450 to 600 SEK, call it \$43 to \$57. Keep that number in view while reading the per-run figures below, which are two orders of magnitude smaller.

The worked example: Opus 5 vs Sonnet 5 vs GPT-5.6 Sol

Take an illustrative long-horizon task: an agent that consumes 500K input tokens over the course of a run (context re-reads included) and produces 50K output tokens. These are assumptions to swap for your own trace data, not measurements. At base list prices, uncached:

  • Claude Opus 5 (\$5/\$25): \$2.50 input + \$1.25 output = \$3.75 per run
  • Claude Sonnet 5 (\$2/\$10 introductory, listed to rise to \$3/\$15 on 1 September): \$1.00 + \$0.50 = \$1.50 per run (\$2.25 at the September list price)
  • GPT-5.6 Sol (\$5/\$30): \$2.50 + \$1.50 = \$4.00 per run

Prompt caching narrows the Claude figures considerably. If 80% of that input volume is cache reads at \$0.50 per million, the Opus run drops to about \$1.95 and the Sonnet run to about \$0.78. OpenAI discounts cached input on its own schedule, so redo this arithmetic with current rates for whichever stack you run.

Now apply the completion formula with hypothetical but plausible parameters for a genuinely hard task. Suppose Opus 5 finishes unattended 9 times in 10 and Sonnet 5 finishes 7 times in 10, with every failure costing 30 minutes of engineer time at \$43:

  • Opus 5: \$3.75 / 0.9 + 0.1 x \$43 = 4.17 + 4.30 = \$8.47 per completed task
  • Sonnet 5: \$1.50 / 0.7 + 0.3 x \$43 = 2.14 + 12.90 = \$15.04 per completed task

The \$2.25 per-run premium for Opus 5 is repaid nineteen times over by a single avoided escalation. Invert the numbers and the story flips: on a routine task where both models succeed 95% of the time, Sonnet's per-run price wins outright and Opus is pure overspend. Neither conclusion is universal. The success-rate gap between models on your task, measured on your traces, decides everything, which is why the deliverable from an Opus 5 evaluation is not a vibe check but a completion-rate table per task type.

Rule of thumb: the premium model pays for itself when (its extra cost per run) is smaller than (the reduction in escalation rate) x (the cost of one escalation). With a \$43 escalation and a \$2.25 premium, Opus 5 only needs to rescue about 5 runs in 100 that Sonnet 5 would have fumbled. For unattended overnight workloads, where discovery of a failure is slow and expensive, the threshold drops further.

Where GPT-5.6 Sol fits

OpenAI previewed GPT-5.6 Sol on 26 June and opened it publicly on 9 July at \$5 input and \$30 output per million tokens, positioning it as the flagship for complex reasoning and long-horizon agentic work above the cheaper Terra and Luna tiers. Against Opus 5 it holds no price advantage: identical input price, 20% more expensive output, and agent runs skew output-heavy once thinking tokens are counted. The only comparison that counts is completion rate on your workload, and there is no substitute for running both against the same task suite. What has changed with this release is that the price argument for defaulting to OpenAI's flagship is gone; the two frontier agent models now cost the same or Anthropic's costs less, so the decision moves entirely to measured completion rates, ecosystem fit and governance.

A decision framework for model selection

  • Default to Sonnet 5 for high-volume, short-loop agent steps: classification, extraction, routine tool calls, anything with a human already in the loop. At \$2/\$10 it is the workhorse, and its behavioural-audit scores were a launch talking point in its own right.
  • Escalate to Opus 5 when the task horizon is long (hours, not minutes), the run is unattended, failure burns engineer time, or the task involves navigating a large codebase with verification loops. These are exactly the properties where a higher unattended completion rate dominates per-token price.
  • Mix tiers inside one agent. Route planning and verification steps to Opus 5 and bulk steps to Sonnet 5 or Haiku. The 1M context and identical API surface make the swap a parameter change, not a rewrite.
  • Tune effort before switching models. Opus 5 at low or medium effort may undercut a retry-prone Sonnet 5 loop. Treat effort as a price dial within the model before reaching for a different model.
  • Re-run the math on 1 September. Sonnet 5's introductory \$2/\$10 is listed to become \$3/\$15, which moves the crossover point noticeably. Any cost model built this summer needs that date in it.
  • Choose GPT-5.6 Sol on merit, not price. If your evaluation shows it completing your specific tasks more reliably, the 20% output premium can be worth paying. Otherwise the pricing no longer argues for it.

Running Opus 5 from an Azure estate

Claude Sonnet 5 reached general availability in Microsoft Foundry on 1 July, and Opus 5 arrived there on launch day. Practically, that means model deployment from the Foundry catalog, billing through an Azure Marketplace subscription in Claude Consumption Units, and Entra ID in front of the endpoint. For organisations whose procurement runs through Microsoft agreements, this removes the classic blocker of onboarding Anthropic as a separate vendor. Ask your Microsoft account team two questions before assuming parity with the Claude API: whether marketplace consumption counts toward your Azure commitment, and which Opus 5 features (fast mode, batch, the 300K output beta) are exposed through Foundry versus the first-party API.

The Swedish and EU angle: residency is the open question

Day-one Foundry availability is genuinely useful, but EU teams should read the deployment fine print before wiring Opus 5 into anything touching personal data. InfoQ's analysis of the Sonnet 5 GA in early July found that Claude models in Foundry currently run on US-based infrastructure only. A deployment created against the Sweden Central region gives you a European endpoint with Global Standard routing, meaning inference may execute anywhere. Unlike Azure OpenAI's first-party models, Claude in Foundry is a third-party marketplace offering in which Anthropic acts as an independent data processor, and Microsoft's documentation notes that flagged content can be routed to US-based trust-and-safety review. Anthropic's own compliance documentation lists Microsoft Foundry in Europe as coming later in 2026, without a date.

For a Swedish enterprise this suggests a two-track posture. Track one: use Opus 5 today for workloads where EU processing is not a hard requirement, such as agents over public documentation, code generation on non-sensitive repositories, or internal tooling cleared by your data classification. Track two: for personal data and regulated workloads, document the gap in your DPIA, note the pending EU deployment in your vendor assessment, and hold the workload on whichever EU-resident model path your review has already approved. Procurement teams drafting an upphandling this autumn should write the residency requirement into the contract rather than assuming the roadmap lands on schedule. One more datapoint for the assessment file: TechCrunch reported that Opus 5 API traffic is exempt from the 30-day retention policy applied to Anthropic's Fable and Mythos tiers, which is the kind of concrete retention detail GDPR Article 30 records benefit from citing.

Takeaways

  • Opus 5 is priced at \$5/\$25 with a 1M context and 128K output, and Anthropic's launch pitch is cost per outcome, not raw capability.
  • Evaluate agents on cost per completed task: run cost divided by success rate, plus escalation rate times the cost of a human rescue.
  • With Swedish engineering rates, one avoided 30-minute escalation pays for roughly nineteen Opus-over-Sonnet run premiums in our worked example. Measure your own gap.
  • Prompt caching at \$0.50 per million cached input tokens is where long-running Claude agents actually save money; structure prompts for cache hits first.
  • GPT-5.6 Sol now costs the same on input and more on output, so choosing it is a capability decision, not a budget one.
  • Claude in Microsoft Foundry runs on US infrastructure today even behind a Sweden endpoint. Classify workloads accordingly and put EU residency in writing in any contract that depends on it.
  • Rebuild your cost model before 1 September, when Sonnet 5's introductory pricing is listed to end.

Sources