All articles
·8 min read

Claude Sonnet 5 vs Opus 4.8: Which Model Should You Actually Use?

ClaudeAnthropicAI DevelopmentAPILLM

Anthropic shipped Claude Sonnet 5 on June 30, 2026. If you're already juggling Sonnet 4.6 and Opus 4.8 in a production app, you probably have the same two questions I did: which one should run my workload, and how do I stop the API bill from creeping up while I figure that out?

I'm a senior frontend developer building React and Next.js products, remote. Picking the right Claude model has quietly become part of my regular stack decisions, the same way choosing a framework or a database is. So this isn't a press-release summary. It's what I've found useful in practice after comparing benchmarks, pricing, and my own request logs.

Jimmy Fallon looking utterly confused, unable to decide
Me, three tabs deep in benchmark pages, trying to pick a model

Quick Answer

  • Sonnet 5 ($3/$15 per million tokens, intro pricing $2/$10 through August 31, 2026) is now the default model for Free and Pro plans and the best value pick for most agentic coding, tool use, and knowledge work.
  • Sonnet 4.6 ($3/$15 per million tokens) is the model Sonnet 5 replaces. It still works, but Sonnet 5 beats it on every published benchmark, so there's not much reason to keep it around.
  • Opus 4.8 ($5/$25 per million tokens) is still the pick for accuracy-critical work, long autonomous agent runs, and anything where a wrong answer costs more than a few extra tokens would.

What's New in Sonnet 5

Sonnet 5 is Anthropic's most agentic Sonnet-tier release yet. It plans multi-step tasks, drives browsers and terminals, and finishes work that earlier Sonnet versions tended to abandon halfway through. Sonnet 5 beats Sonnet 4.6 on every published benchmark, scoring 63.2% on SWE-bench Pro, 81.2% on OSWorld-Verified, and 57.4% on Humanity's Last Exam.

The gap with Opus 4.8 has closed too, more than I expected. Sonnet 5 edges past Opus 4.8 on the GDPval-AA v2 knowledge-work benchmark, ties it almost exactly on Humanity's Last Exam with tools, and lands at close to 93% of Opus capability for 60% of the price. If you're routing document analysis, research, or content generation, that's worth paying attention to.

Opus 4.8 still wins on raw coding depth and reasoning without tool access. It leads Sonnet 5 on SWE-bench Pro by 6 points, on terminal use by about 2 points, and on Humanity's Last Exam without tools by 6.6 points. If your workload is long, multi-hour agent runs on a large codebase, that's where Opus still earns its premium.

Benchmark Snapshot

BenchmarkSonnet 4.6Sonnet 5Opus 4.8
SWE-bench Pro (agentic coding)58.1%63.2%69.2%
OSWorld-Verified (computer use)78.5%81.2%83.4%
Terminal-Bench 2.167.0%80.4%82.7%
Humanity's Last Exam (with tools)57.4%57.9%
GDPval-AA v2 (knowledge work)1,6181,615

For reference, Sonnet 4.6 itself is roughly 1.7x cheaper than Opus 4.8 on both input and output pricing, but Opus 4.8 leads on 9 out of 10 tracked benchmarks against Sonnet 4.6, which is exactly the gap Sonnet 5 was built to close.

The Tokenizer Change Nobody Mentions in the Launch Post

Here's the part most comparison articles skip, and the part that shows up on your invoice. Sonnet 5 uses a new tokenizer, the same one introduced with Opus 4.7, and the same piece of text can now map to somewhere between 1.0 and 1.35 times more tokens than before.

Which means: switch from Sonnet 4.6 to Sonnet 5 without re-checking your token counts, and your bill can go up without you noticing, even though the per-token price looks the same or lower. Anthropic seems to have priced the intro window to keep the switch close to cost-neutral for most people, but I wouldn't take that on faith. Run your own numbers first.

Effort Levels: The Dial Most Developers Never Touch

Both Sonnet 5 and Opus 4.8 expose adjustable effort levels: low, medium, high, and xhigh on Sonnet 5, up to xhigh on Opus 4.8. More effort means more reasoning tokens per request, which means higher quality and a higher bill.

The mistake I keep seeing, and honestly one I made myself early on, is leaving every request at max effort by default. Fine for a demo. Expensive at production volume, because you're paying top price for tasks that never needed it. At maxed-out effort, Sonnet 5 performs close to Opus 4.8's medium-to-high setting on computer-use and agentic search benchmarks, but running Sonnet 5 at that top effort level can end up costing more than Opus 4.8 at a comparable setting. So if a task genuinely needs top-tier reasoning, Opus at moderate effort might be the cheaper route, not Sonnet cranked all the way up.

Here's the rule of thumb I've settled on for my own projects:

  • Low/medium effort, Sonnet 5 — everyday coding, code review, UI generation, content extraction, chat features.
  • High effort, Sonnet 5 — multi-step agent tasks, PR review across several files, tool-calling workflows.
  • Opus 4.8, xhigh — long autonomous runs, large codebase migrations, anything where a wrong answer is expensive to fix.

Managing Token Spend: What Moves the Needle

Picking a model is half the job. The real cost control happens at the request level, and this is where most teams leave money on the table. In rough order of what pays off first:

1. Prompt caching, by far the biggest lever

Prompt caching cuts cached input cost by 90%. If your system prompt, tool definitions, or a large chunk of document context repeats across requests, mark it with a cache breakpoint instead of paying full price to resend it every single time.

A few mechanics worth knowing before you set this up:

  • Cache hits require the prompt segment to be 100% identical up to and including the cached block.
  • Cache entries stay alive for at least 5 minutes on the standard tier, or 1 hour on the extended one.
  • The minimum cacheable block is 1,024 tokens.
  • The write premium runs about 25% over standard input pricing — it pays for itself after one hit.

Where I use this in a Next.js or agentic setup:

  • The system prompt and coding style guidelines
  • Tool and function schemas in agentic workflows, since these barely change between calls
  • Large reference documents, style guides, or codebase context fed into RAG pipelines

2. Batch processing for anything that isn't interactive

Batch processing is 50% cheaper across all models, and the quality is identical to a real-time call. The only tradeoff is turnaround time. Blog drafts, nightly content audits, bulk data extraction, offline dataset evaluation: none of that needs a synchronous call. Route it through the Batch API and pocket the difference.

3. Route by task, not by habit

The biggest budget leak I've seen isn't a bad model choice. It's defaulting every request to the most capable model because it's easier than thinking about it. A simple routing layer fixes this: cheap tasks go to Haiku, everyday coding and agentic work goes to Sonnet 5, and only the requests that fail a quality check or clearly need deep reasoning get escalated to Opus 4.8. Building this as a thin wrapper around your API client takes an afternoon and pays for itself fast once volume picks up.

4. Watch the 200K input threshold

Cross around 200K input tokens in a single request and you can trigger long-context pricing. If you're dumping an entire repository or a long document into context out of habit, stop and ask whether you need all of it every time, or whether retrieval plus caching gets you the same result for less.

5. Track usage instead of guessing

Every response includes a usage object with input tokens, cache reads, cache writes, and output tokens broken out. Log it per request while you're developing. It's the only real way to know whether your caching is hitting, or whether you're paying full price for something you assumed was cached.

The Bottom Line

For most day-to-day frontend and full-stack work, Sonnet 5 is the sensible default now. It's cheaper than Opus 4.8, close to it on knowledge work and tool-augmented reasoning, and it's already the default on Free and Pro plans. I don't see a strong reason to keep Sonnet 4.6 in rotation anymore. Sonnet 5 beats it across the board at basically the same price.

Keep Opus 4.8 around for the tasks where accuracy has real consequences: production-critical migrations, security-sensitive code review, long agent runs where a stalled task costs more than the extra tokens would.

Honestly, the model matters less than most people think once caching, batching, and effort levels are tuned. A well-optimized Sonnet 5 setup will often beat a lazy Opus 4.8 setup on both cost and reliability. Get the plumbing right first.

FAQ

Is Claude Sonnet 5 better than Opus 4.8?

Not across the board, but it's close enough on most tasks that the price difference makes Sonnet 5 the better default. Opus 4.8 still leads on raw coding depth and reasoning without tool access.

Should I migrate from Sonnet 4.6 to Sonnet 5 right away?

Yes for most workloads, but recalculate your token counts first because of the new tokenizer. Take advantage of the intro pricing window through August 31, 2026 while you test the migration.

What's the fastest way to cut my Claude API bill?

Set up prompt caching on anything you send repeatedly (system prompts, tool schemas, reference documents), and move non-interactive workloads to the Batch API. Those two changes alone typically account for the largest savings.