Claude Opus 4.7 API pricing: previous flagship at 87.6% SWE-bench

Opus 4.7 and Opus 4.8 cost exactly the same — $5/1M input, $25/1M output. The current flagship outperforms by 1 SWE-bench point. The real decision is whether you need Opus at all versus Sonnet 4.6, which handles most production tasks at 40% lower input cost.

By the benchr team · · Figures verified against official sources, June 6, 2026 · View changelog

Input / 1MAnthropic
Output / 1MAnthropic
SWE-benchverified
Contextmax window

Pricing breakdown

claude-opus-4-7 — official Anthropic pricing
TierRate / 1M tokens
Standard input$5.00
Standard output$25.00
Cached input$0.50
Context window1,000,000 tokens
Max output32,000 tokens

Opus 4.7 vs Opus 4.8: the 1-point question

Claude Opus 4.8 improves SWE-bench Verified from 87.6% to 88.6% — one percentage point. Both versions are priced identically at $5/1M input and $25/1M output. In practice, a 1-point SWE-bench difference means Opus 4.8 resolves roughly 1 additional issue per 100 that would have failed on Opus 4.7. For most production workloads, this difference is invisible unless you're running large coding pipelines at scale with measurable pass/fail rates.

If you already have Opus 4.7 running in production and your quality metrics are acceptable, the cost of migration (prompt re-testing, regression checks, system prompt tuning) likely outweighs the benchmark improvement. For greenfield projects, start with Opus 4.8 — there is no reason to use the older version.

Opus vs Sonnet: the real cost decision

Claude Sonnet 4.6 costs $3/1M input and $15/1M output — 40% cheaper on input, 40% cheaper on output. Sonnet 4.6 scores 79.6% on SWE-bench Verified, an 8-point gap below Opus 4.7. For complex multi-file refactors, architecture reviews, or tasks where output quality has a direct dollar value, that 8-point gap is meaningful. For general-purpose chat, summarization, and classification, Sonnet 4.6 handles the workload without paying the Opus premium.

A practical test: if you cannot tell the difference between Opus and Sonnet on your specific tasks in a blind eval, you should be on Sonnet. The 8-point SWE-bench gap shows up most clearly in multi-step code generation where errors compound across steps.

Caching and the effective rate

Cached input for Claude Opus 4.7 costs $0.50/1M — 90% off standard. For agents with a large fixed system prompt (say 80K tokens of tool definitions and instructions), a 90% cache hit rate brings the effective input cost to roughly $0.95 per million tokens — comparable to uncached Sonnet 4.6 at $3 per million. Output doesn't cache, so output-heavy workloads still pay the full Opus premium on the output side.

Cost scenarios

At medium volume — 5M input tokens and 1.5M output per month — Opus 4.7 costs $25 + $37.50 = $62.50/month. Sonnet 4.6 at the same volume: $15 + $22.50 = $37.50/month. The Opus premium is $25/month at this scale. At 90% cache hit on input: approximately $4.75 + $37.50 = $42.25/month — the cached Opus rate is within 13% of uncached Sonnet, which narrows the decision considerably for systems with stable, cacheable context.

Use-case fit

Best for: Complex multi-file code generation; architecture review; long-document analysis requiring sustained reasoning over 100K+ tokens; production agent loops where output quality directly maps to business value and the Opus premium is justified by error-reduction ROI.

Skip if: You're starting a new project — use Opus 4.8 instead. Also skip if Sonnet 4.6 handles your eval benchmarks — the 40% cost difference compounds quickly at production scale.

Decision checklist

Run your actual task sample on both Claude Sonnet 4.6 and Claude Opus 4.7 in a blind evaluation before committing to Opus pricing. If you can't detect the quality difference in your specific workload, Sonnet is the right economic choice.

For Opus 4.7 vs 4.8 specifically: measure whether your pipeline has task types where a 1-point SWE-bench improvement is detectable at your scale. If pass rates are already above 90%, the marginal 1% improvement from Opus 4.8 is noise.

Frequently asked

What is the difference between Claude Opus 4.7 and Opus 4.8?

Opus 4.8 scores 88.6% on SWE-bench vs 4.7's 87.6% — 1 point higher. Both cost $5/1M input, $25/1M output. For existing Opus 4.7 deployments, migration is only warranted if you can measure the 1-point difference in your specific task failure rates. For new projects, start with Opus 4.8.

When should I use Claude Opus 4.7 instead of Sonnet 4.6?

When the 8-point SWE-bench gap (87.6% vs 79.6%) is measurable and costly in your workload — primarily complex multi-file coding and reasoning-intensive tasks. For general production traffic, Sonnet 4.6 handles most tasks at 40% lower input cost.

Does Claude Opus 4.7 support prompt caching?

Yes. Cached input costs $0.50/1M — 90% off the $5 standard rate. At 90% cache hit on a large system prompt, the effective input cost drops to approximately $0.95 per million, making Opus competitive with uncached Sonnet 4.6 pricing for cache-friendly workloads.

Changelog

  • — Expanded with Opus 4.7 vs 4.8 analysis, Sonnet comparison, caching economics, and cost scenarios.
  • — Published. Pricing verified at anthropic.com/pricing.

Sources

  • Anthropic API pricing — anthropic.com/pricing (verified June 6, 2026)
  • SWE-bench Verified leaderboard — swebench.com (verified June 6, 2026)
  • benchr models.json — verified June 6, 2026