Skip to main content
tokenmath
Menu

By tokenmath Research Desk · Pricing verified 2026-07-06

Claude 4.8 Opus token & cost calculator

Claude 4.8 Opus is Anthropic's current flagship — the most capable model in the Claude line and the default choice when the task is genuinely hard and correctness is the product. It prices at $5 input / $25 output per million tokens, carries the full 1,000,000-token context window, and supersedes Opus 4.7 at the same rate. Unless you've deliberately pinned an older snapshot, 4.8 is the Opus you want.

The economics changed with this generation: Opus used to command a 5× premium over Sonnet, but at $5/$25 it's only about 1.7× Claude 4.5 Sonnet. That makes reaching for Opus far less punishing than it once was — though Sonnet is still cheaper per token, so the discipline is unchanged: route the easy majority to Sonnet or Haiku and spend Opus on the requests that actually need its reasoning.

Client-side. Never uploaded.
0 / 1,000,000 charactersContext window: 1,000,000 tokens
Or start with an example
Total estimated cost
$0.026Claude 4.8 Opus
Tokens±2% approx
0
Input cost
$0.00
Output cost (est.)
$0.026
@ 1,024 response tokens
Context used
0%
of 1,000,000
Verified 2026-07-06 · ±2%
Saved scenariosnone yet

Saved on this browser only — never uploaded. Up to 10 scenarios.

Tip: save a scenario when you have a prompt + model + response length you might revisit. Useful for sizing features before committing to a vendor.

Verify privacysince this page loaded — updates live
Prompt uploads0Always 0 — by design
Outgoing requests0Analytics + page assets only — no prompt content
Cookies on this origin0Vercel Analytics + Clarity may set first-party cookies
localStorage keys0Theme preference + saved scenarios live here
Server endpoints1/api/og only — accepts title + subtitle, never prompt text
Inspect

Open DevTools → Network. Type into the calculator. No request bodies should contain your prompt text.

Pricing

Opus 4.8 is flat-priced at $5/$25 across its full million-token context — no tier surcharge on large inputs. Output is 5× input, the same input-to-output ratio as the rest of the Claude line. An optional Fast mode research preview runs at double the rate ($10/$50) for lower latency; this calculator prices the standard tier.

TierInput $/MOutput $/M
All input$5$25
Context window1,000,000 tokens

Verified against platform.claude.com on 2026-07-06.

Worked examples

Concrete costs at Opus 4.8's $5/$25 rate — from a short turn up to the large single-call inputs its million-token window allows. Paste your own prompt above to price it exactly.

ScenarioInputOutputCost
Short chat turn
A one-off question with a small system prompt.
800400$0.014
Agentic coding step
Repo context plus tool results and a substantial edit.
40,0006,000$0.350
400K-token input
A large codebase or document set in a single call.
400,0006,000$2.15
Near-full context
Close to the million-token ceiling in one request.
900,0008,000$4.70

The agentic case is the one to watch: coding agents re-send the full working context plus tool output every turn, so a long Opus session compounds fast. Cache the stable prefix (system prompt, repo map, docs) aggressively — cached reads run at roughly a tenth of the input rate — and the bill flattens dramatically.

How is this counted?

Opus 4.8 uses Anthropic's newer tokenizer, which produces roughly 30% more tokens than the previous Claude encoding on the same text. Anthropic doesn't publish a client-side tokenizer, so we approximate: count with cl100k_base (gpt-tokenizer, MIT), then apply a ~1.3× calibration to track the newer tokenizer's higher count. That makes Opus estimates rougher than for older Claude models — budget ±10%, not ±2% — so treat the number as a planning figure and reconcile against the API response headers. Inputs over 50,000 characters run in a Web Worker.

FAQ

Should I use Opus 4.8 or Opus 4.7?
Default to 4.8 — it's the current flagship, same $5/$25 per million and the same 1,000,000-token context window as 4.7, with the latest reasoning improvements. Reach back for 4.7 only if you've pinned it in production and want byte-for-byte reproducibility, or you're mid-eval and don't want the model changing underneath you. There's no price reason to prefer one over the other.
What does Fast mode cost?
Fast mode is an optional premium that trades money for latency: it runs Opus 4.8 at $10 input / $50 output per million — double the standard rate — across the full context window. It's a research-preview speed tier, not the default. This calculator prices standard Opus 4.8 ($5/$25); if you enable Fast mode, double the numbers.
How accurate is the Opus token count?
Rougher than for older Claude models. Opus 4.8 uses Anthropic's newer tokenizer, which produces about 30% more tokens than the previous encoding on the same text. We approximate it by applying a ~1.3× calibration to the cl100k_base count — a solid planning estimate, but the true multiplier shifts with content, so treat Opus counts as roughly ±10% rather than the ±2% we quote for older Claude models. Reconcile against the API response headers for billing.
What is the context window?
1,000,000 tokens — 5× the 200,000 that Sonnet 4.5 and Haiku 4.5 offer, and the same million-token window as Opus 4.7 and Sonnet 5. The calculator warns you when input alone would exceed it.
Is Opus 4.8 worth it over Sonnet?
At $5/$25 Opus 4.8 is about 1.7× Sonnet 4.5's rate — the smallest Opus premium in a while, but still the priciest model here. Use it when a lift in correctness on genuinely hard work pays for itself: deep agentic coding, multi-document synthesis, ambiguous reasoning. If Sonnet clears the task with a tighter prompt, that's still the cheaper answer.

Compare against every other model

To see this exact prompt scored against every supported model, sorted by total cost, paste it into the home calculator and toggle Compare across all models. Numbers are exact for OpenAI and approximate for Claude and Gemini — within ±2–3% for most, wider for the newer-tokenizer Claude models (Opus 4.7/4.8, Sonnet 5).

The natural comparison set: Opus 4.7 (the prior flagship, identical price), Claude 4.5 Sonnet (the workhorse most requests should default to), and Claude 5 Sonnet (the current-generation Sonnet with the same million-token window at a lower rate).

Keyboard shortcuts

Press ? any time to reopen this list.

Show this overlay?
Toggle themet
Focus the prompt textarea/
Go to homegh
Go to modelsgm
Go to pricing datagp
Go to changeloggc
Go to aboutga
Close overlays / dialogsEsc

We use Vercel Web Analytics for aggregate page metrics and (optionally) Microsoft Clarity for masked session replay. Prompt content is never sent. Read the privacy policy.