#tHow Many Tokens?

← All models

Claude Opus 4.8: token counter & pricing

Anthropic · exact (uses official tokenizer) · pricing as of 2026-05-31.

Provider
Anthropic
API model ID
claude-opus-4-8
Context window
200,000 tokens
Input price
$5.00 per 1M tokens
Output price
$25.00 per 1M tokens
Tokenizer accuracy
exact (uses official tokenizer)
Pricing as of
2026-05-31

Open the counter to count tokens for Claude Opus 4.8 in real time.

What is Claude Opus 4.8?

Claude Opus 4.8 is Anthropic's flagship model (released 2026-05-28), the most capable model in the Claude family, designed for complex reasoning, long-context tasks, and high-stakes work where output quality matters more than per-call cost. It supersedes Opus 4.7 at the same standard-mode pricing: $5 per 1M input tokens, $25 per 1M output tokens.

How tokens are counted here

Opus counts come straight from Anthropic's official /v1/messages/count_tokens endpoint, called through our serverless proxy. The number you see is the number Anthropic's billing system uses: exact, not an estimate.

Nothing is retained along the way. The proxy forwards the prompt to the tokenization endpoint and discards it; per Anthropic's API policy on count_tokens, prompts are never logged, stored, or used for training.

Opus 4.8 inherits the Opus 4.7 tokenizer. Per Anthropic's documentation, this tokenizer can produce up to 35% more tokens than earlier Claude models (Opus 3 and earlier Sonnet/Haiku) for the same text. Our counter shows the live Opus 4.8 count returned by the API, so what you see is what you'll be billed, but if you're comparing Opus 4.8 to Sonnet 4.6 or Haiku in the same table, expect Opus to show a larger token count for identical input. That's the tokenizer change, not a bug.

What's new in Opus 4.8

What Claude Opus costs in production

Take a code-review bot on a mid-size engineering team: 50 pull requests a day, each sending about 3,000 tokens of diff and context and getting back roughly 600 tokens of review.

The same workload on Claude Sonnet 4.6 ($3/$15) runs $13.50 + $13.50 = $27/month, a 40% saving if Sonnet's reviews hold up on your codebase. Going the other direction, GPT-5.5 Pro ($30/$180) bills $135 + $162 = $297/month for identical volume. Opus sits well below the premium reasoning tiers while staying in frontier territory, which is why per-PR review is a workload it tends to win on cost-for-quality.

Migrating from Opus 4.7

This is the easiest Claude migration in a while. Change the model string from claude-opus-4-7 to claude-opus-4-8 and you're done: standard-mode pricing is flat at $5/$25, and Opus 4.8 inherits the 4.7 tokenizer, so existing token estimates, context budgets, and truncation logic carry over unchanged. No re-benchmarking of prompt sizes needed.

The one billing change worth knowing: the fast tier dropped from $30/$150 on Opus 4.7 to $10/$50 on 4.8 (tracked separately as claude-opus-4-8-fast). If you previously ruled out fast mode on price, that math has changed by 3x.

Claude Opus vs the obvious alternative

The head-to-head that matters is GPT-5.5 vs Claude Opus: GPT-5.5 charges the same $5/M on input but $30/M on output versus Opus's $25/M, so output-heavy work runs about 17% cheaper on Opus. Against the older GPT-4o ($2.50/$10), Opus costs 2x on input and 2.5x on output; you're paying for reasoning depth GPT-4o doesn't have. For hard logic problems specifically, also weigh o3 vs Claude Opus.

When to use Claude Opus over Sonnet or Haiku

For most chatbot, classification, and summarization workloads, Claude Sonnet 4.6 is 5× cheaper and usually indistinguishable in output quality. Use Opus when you've measured Sonnet falling short on your task.

Common questions

Should I use Standard mode or Fast mode?

Standard mode at $5/$25 is the right default. Fast mode at $10/$50 (2x the cost) gets you tokens at roughly 2.5x normal speed: worth it for interactive agent loops and latency-bound chat, not worth it for batch summarization or background workflows where end-to-end time doesn't change the user experience.

Why is Claude Opus pricing so high compared to GPT-4o mini?

GPT-4o mini is positioned as a high-volume, low-cost model; Claude Opus is positioned as a frontier reasoning model. They aren't competing for the same workloads. The comparison that matters is Claude Opus vs GPT-4o vs Gemini 3.1 Pro, those are the frontier-class models.

Does the 200,000-token context window cost more?

No, input is billed per token regardless of where in the context window the token sits. A 100,000-token prompt costs the same per token as a 1,000-token prompt. The total cost just scales with the number of tokens you send.

How do I count tokens for a prompt that includes images or PDFs?

Image and PDF tokens are counted by the same Anthropic endpoint, but our counter only handles text input today. For multimodal token counts, send the request directly to Anthropic's API.

Compare Claude Opus 4.8 to other models

Detailed comparisons