Claude Sonnet 5 vs Opus 4.8: Pricing, Benchmarks, and When to Route Each Model
Sonnet 5 costs 60% less than Opus 4.8 per token and matches it on BrowseComp and Terminal-Bench — but Opus 4.8 still leads on SWE-bench and OSWorld. We break down pricing (including the introductory window through August 31), benchmarks, effort levels, and when to route each model.
Claude Sonnet 5 launched on June 30, 2026, and immediately blurred the line between Anthropic's Sonnet and Opus tiers. At introductory pricing of $2/$10 per million tokens (through August 31, 2026), it delivers performance that previously required the $5/$25 Opus tier. The question every API developer is asking: when do you still need Opus 4.8, and when can you save 60% by routing through Sonnet 5?
We compared pricing, benchmarks, effort levels, and real-world routing tradeoffs to help you decide — or set up fallback routing through both via TheRouter.
Sources: Anthropic Pricing, retrieved 2026-07-01; Introducing Claude Sonnet 5, retrieved 2026-07-01; Claude Sonnet 5 vs Opus 4.8 Benchmarks, retrieved 2026-07-01; Claude Sonnet Product Page, retrieved 2026-07-01.
TL;DR — At a Glance
| Dimension | Claude Sonnet 5 | Claude Opus 4.8 |
|---|---|---|
| Input / Output per 1M tokens | $2 / $10 (intro) → $3 / $15 (standard) | $5 / $25 |
| Cache hit price (input) | $0.20 / 1M tokens (intro) → $0.30 (standard) | $0.50 / 1M tokens |
| Context window | 1M tokens | 1M tokens |
| Max output tokens | 64,000 | 128,000 |
| Tokenizer | New (≈30% more tokens for same text) | New (same as Sonnet 5) |
| SWE-bench Verified | 85.2% | 88.6% |
| SWE-bench Pro | 63.2% | 69.2% |
| BrowseComp | 84.7% | 84.3% |
| Terminal-Bench 2.0 | 80.4% | 74.6% |
| OSWorld-Verified | 81.2% | 83.4% |
| Extended thinking | Yes (effort levels) | Yes (effort levels, xhigh) |
| Best for | Cost-sensitive coding agents, high-volume agentic work, browser automation | Maximum SWE-bench accuracy, long-output tasks, extended reasoning budgets |
What Sonnet 5 Changes
Anthropic describes Sonnet 5 as "the most agentic Sonnet yet." In concrete terms, that means:
-
Opus-class agentic quality at Sonnet pricing. Early access partners report that Sonnet 5 finishes complex multi-step tasks where Sonnet 4.6 would stop short — investigating bugs, writing reproducing tests, and verifying fixes in a single pass.
-
Effort-level flexibility. Like Opus 4.8, Sonnet 5 supports effort levels that let you trade thinking depth for speed and cost. At medium effort, Sonnet 5 is substantially cheaper than Opus 4.8 at any effort level.
-
New tokenizer. Both Sonnet 5 and Opus 4.7+ use a newer tokenizer that produces approximately 30% more tokens for the same text. This improves quality but means raw token counts are not directly comparable to Sonnet 4.6 and earlier models.
-
Lower cybersecurity capability. Sonnet 5 was not trained on cybersecurity tasks and cannot develop working exploits, unlike Opus 4.8. For security research workloads, Opus remains necessary.
Pricing Deep-Dive: The Two-Phase Window
Sonnet 5 has a unique two-phase pricing structure:
| Phase | Input | Output | Cache Write (5m) | Cache Hit | Period |
|---|---|---|---|---|---|
| Introductory | $2 / MTok | $10 / MTok | $2.50 / MTok | $0.20 / MTok | Through August 31, 2026 |
| Standard | $3 / MTok | $15 / MTok | $3.75 / MTok | $0.30 / MTok | From September 1, 2026 |
| Opus 4.8 | $5 / MTok | $25 / MTok | $6.25 / MTok | $0.50 / MTok | Current |
During the introductory window, Sonnet 5 is 2.5x cheaper than Opus 4.8 on both input and output tokens. After September 1, the gap narrows to approximately 1.67x cheaper.
Effective cost per task depends on how many tokens each model consumes. Sonnet 5's new tokenizer produces ≈30% more tokens for the same text, which partially offsets the per-token savings when comparing against Opus models using the same tokenizer. But since Opus 4.7+ also uses this tokenizer, the comparison against Opus 4.8 specifically is apples-to-apples.
Batch processing and caching savings
Both models support prompt caching (up to 90% savings on cache hits) and batch processing (50% discount). These stack multiplicatively:
- Sonnet 5 introductory + cache hit: $0.20 input / $10 output — production workloads with repeated system prompts can cut input costs to $0.20 per million tokens
- Opus 4.8 + cache hit: $0.50 input / $25 output
For high-volume agentic workloads with shared system prompts, the Sonnet 5 cost advantage widens further.
Benchmark Comparison: Where Each Model Leads
All benchmark scores below are vendor-reported by Anthropic unless noted otherwise. We have not independently verified them.
Coding benchmarks
| Benchmark | Sonnet 5 | Opus 4.8 | Delta |
|---|---|---|---|
| SWE-bench Verified | 85.2% | 88.6% | Opus +3.4pp |
| SWE-bench Pro | 63.2% | 69.2% | Opus +6.0pp |
| SWE-bench Multilingual | 78.3% | 84.4% | Opus +6.1pp |
| Terminal-Bench 2.0 | 80.4% | 74.6% | Sonnet +5.8pp |
Opus 4.8 leads on the SWE-bench family — the go-to benchmark for real-world GitHub issue resolution. But Sonnet 5 wins on Terminal-Bench 2.0, which tests interactive terminal workflows. For coding agents that spend more time in the terminal than on PR-level patches, Sonnet 5 may actually be the stronger choice.
Agentic and tool-use benchmarks
| Benchmark | Sonnet 5 | Opus 4.8 | Delta |
|---|---|---|---|
| BrowseComp | 84.7% | 84.3% | Sonnet +0.4pp |
| OSWorld-Verified | 81.2% | 83.4% | Opus +2.2pp |
| Toolathlon | 54.3% | 59.9% | Opus +5.6pp |
BrowseComp measures agentic search — Sonnet 5 edges out Opus 4.8 here. OSWorld-Verified tests computer use; Opus retains a small lead.
Knowledge and reasoning
| Benchmark | Sonnet 5 | Opus 4.8 | Delta |
|---|---|---|---|
| Humanity's Last Exam | 57.4% | 57.9% | Opus +0.5pp |
| HealthBench Professional | 57.8% | 55.8% | Sonnet +2.0pp |
The models are closely matched on frontier knowledge tasks.
Effort-Level Routing: Sonnet 5 at High vs Opus 4.8 at Medium
Both models support Anthropic's effort levels: low, medium, high, and xhigh (Opus 4.8 only). Extended thinking tokens are billed at output token rates.
The key insight from Anthropic's own launch data: Sonnet 5 at higher effort can match Opus 4.8 on some tasks, while still costing less per token. Anthropic's BrowseComp and OSWorld charts show Sonnet 5's cost-performance curve covering a wider range than Opus 4.8's, with Sonnet 5 at high effort approaching or matching Opus 4.8 at medium effort on several benchmarks.
This creates a practical routing strategy:
# Route coding-agent tasks based on complexity
def pick_model(task_complexity: str) -> dict:
if task_complexity == "routine":
# Simple refactors, test generation, doc updates
return {"model": "claude-sonnet-5", "effort": "medium"}
elif task_complexity == "standard":
# Multi-file changes, bug investigation
return {"model": "claude-sonnet-5", "effort": "high"}
elif task_complexity == "frontier":
# Long-horizon agents, complex architecture changes
return {"model": "claude-opus-4.8", "effort": "high"}
else:
# Maximum accuracy required
return {"model": "claude-opus-4.8", "effort": "xhigh"}
When Opus 4.8 Still Wins
Despite Sonnet 5's strong showing, there are clear cases where Opus 4.8 justifies its 2.5x price premium:
-
SWE-bench-class tasks. If your workload resembles GitHub issue resolution across large codebases, Opus 4.8's 88.6% vs 85.2% on SWE-bench Verified translates to meaningfully fewer failed patches in production.
-
Long output generation. Opus 4.8 supports 128K output tokens vs Sonnet 5's 64K. For tasks that generate large codebases, detailed reports, or complete file rewrites, Opus 4.8 won't truncate.
-
Extended reasoning budget (xhigh effort). Only Opus 4.7+ supports the
xhigheffort level, which allocates significantly more thinking tokens. For problems that benefit from deep chain-of-thought reasoning, this matters. -
Cybersecurity research. Sonnet 5 was deliberately not trained on cybersecurity tasks. Opus 4.8 has substantially stronger capabilities here.
-
Computer use reliability. Opus 4.8 leads on OSWorld-Verified (83.4% vs 81.2%) — a small but consistent advantage for production computer-use agents.
Cross-Provider Context: Sonnet 5 vs GPT-5.5 Pro
For teams considering non-Anthropic alternatives, here is how Sonnet 5 compares to OpenAI's frontier offering:
| Dimension | Sonnet 5 (intro) | Sonnet 5 (standard) | GPT-5.5 Pro |
|---|---|---|---|
| Input / 1M tokens | $2 | $3 | $48 |
| Output / 1M tokens | $10 | $15 | $288 |
| Context window | 1M | 1M | 1M |
GPT-5.5 Pro operates in a fundamentally different price tier — roughly 19x more expensive on output tokens than Sonnet 5 at standard pricing. The two models target different market segments: GPT-5.5 Pro for maximum reasoning depth on individual high-value queries, Sonnet 5 for high-volume agentic workloads.
For workloads where you need both providers as fallbacks, TheRouter routes OpenAI-compatible requests across Anthropic and OpenAI endpoints, with automatic fallback when one provider returns errors or hits rate limits.
Decision Matrix
Pick Sonnet 5 if:
- Cost efficiency matters and your workload is high-volume
- You need agentic search (BrowseComp-class tasks) or terminal automation
- Your coding tasks are standard complexity (not frontier SWE-bench-level)
- You want to lock in introductory pricing through August 31
- You're migrating from Sonnet 4.6 and want a drop-in upgrade
Pick Opus 4.8 if:
- You need maximum SWE-bench accuracy for automated PR generation
- Your tasks require >64K output tokens
- You need
xhigheffort for deep extended thinking - You're running cybersecurity research workflows
- Reliability on computer-use tasks is critical
Route through both if:
- You want Sonnet 5 as the default with Opus 4.8 fallback for complex tasks
- You want effort-level-aware routing (Sonnet 5 at high effort first, escalate to Opus 4.8 if quality is insufficient)
- You need provider resilience across Anthropic model versions
TheRouter Integration
We route OpenAI-compatible requests through Anthropic, including both Claude Opus 4.8 and Claude Sonnet 4.6. Sonnet 5 is not yet in our model catalog — we are tracking it and will add anthropic/claude-sonnet-5 once we verify the routing path. In the meantime, you can route Sonnet 5 requests directly to the Anthropic API using model ID claude-sonnet-5.
For fallback routing between Sonnet and Opus tiers, see our LLM API Fallback Routing Guide. TheRouter supports provider-level and model-level fallback when a primary model returns errors or hits rate limits.
FAQ
Will introductory pricing apply to cached tokens too? Yes. Cache write and cache hit prices are proportionally lower during the introductory period ($2.50/$0.20 per MTok for 5-minute cache writes/hits vs $3.75/$0.30 at standard pricing).
Does the new tokenizer affect my existing prompts? If you're migrating from Sonnet 4.6 or earlier, the same prompt will consume approximately 30% more tokens on Sonnet 5. However, Opus 4.7 and 4.8 already use the same tokenizer, so Sonnet 5 vs Opus 4.8 comparisons are apples-to-apples.
Can I use Sonnet 5 on Bedrock and Vertex AI? Yes. Sonnet 5 is available on Amazon Bedrock and Google Cloud Vertex AI. Regional endpoints include a 10% premium over global endpoints.
What model ID do I use in the API?
Use claude-sonnet-5 for the Claude Platform API. On Bedrock, use the corresponding Bedrock model ID.
Should I switch from Sonnet 4.6 immediately? For most workloads, yes. Sonnet 5 is a strict improvement over Sonnet 4.6 at identical (or lower, during the introductory window) pricing. The main caveat is the new tokenizer — test your prompts to ensure they fit within expected token budgets.
Benchmark data in this post is vendor-reported by Anthropic and third-party aggregators. We have not independently verified these scores. Pricing and model availability are accurate as of July 1, 2026. Check the Anthropic pricing page for current rates.