Claude Token Counter, now with model comparisons
TL;DR Highlight
Opus 4.7's new tokenizer counted 1.46x more tokens than 4.6 on the same system prompt
Who Should Read
A backend developer running an LLM service who wants to estimate API cost changes before moving from Opus 4.6 to 4.7
Core Mechanics
- Opus 4.7 changes the tokenizer
- As far as the author can tell, Opus 4.7 is the first Claude model to change its tokenizer.
- So comparisons are only meaningful between 4.7 and 4.6.
- Same input maps to up to 1.35x tokens
- Anthropic said in the 4.7 announcement that the same input can map to roughly 1.0-1.35x more tokens depending on content type.
- They framed it as the tradeoff for better text processing.
- The Opus 4.7 system prompt hit 1.46x
- The author pasted the Opus 4.7 system prompt and got 1.46x the tokens of Opus 4.6.
- That exceeds the 1.0-1.35x range Anthropic stated.
- Same price, about 40% higher cost
- Opus 4.7 keeps 4.6 pricing at $5 per million input tokens and $25 per million output tokens.
- The author expects roughly 40% higher cost because of token inflation.
- The image 3x jump came from resolution
- A 3456x2234 PNG gave 3.01x the tokens of 4.6.
- A 682x318 image took 314 tokens on 4.7 versus 310 on 4.6, effectively the same.
- Text-heavy PDFs rose much less
- A 15MB, 30-page text PDF was 60,934 tokens on 4.7 versus 56,482 on 4.6.
- That is a 1.08x multiplier, well below the raw text figure.
Community Reactions
- Opinion that the tokenizer was redesigned
- One commenter guessed Anthropic made the tokenizer more semantically aware by splitting capitalization, spaces and suffixes.
- That would make learning easier for the model but raise token usage.
- Experience of 40% more tokens
- One commenter said their prompt used 40% more tokens on Opus 4.7.
- Another said they would default back to 4.6 and pass claude-opus-4-7 only when needed, calling the inflation very real.
- Collected token-saving tips
- One commenter hit the limit with a single prompt and asked for tips.
- Their list: pick models by task, turn big repos into compact structures, cap output tokens, disable unused MCP, move CLAUDE.md content into skills.
- View that cost must be weighed with quality
- One commenter said measuring the tokenizer is only one input to the cost-benefit tradeoff.
- They argued the real test is whether 4.7 beats 4.6 on your benchmarks at the same dollar budget.
How to Apply
- Compare 4.6 and 4.7 tokens on your prompts
- Today, paste your system prompt and a typical input into Claude Token Counter for both models.
- Multiply the ratio by your monthly input tokens to estimate cost.
- Build a ratio table by content type
- Measure plain text, code, PDFs and images the same way.
- Keep 4.6 first for the types with the largest ratio.
- Downsample images before upload
- If you send many high-resolution images, add a resizing step before upload.
- Target only large images, since small ones show almost no difference.
- Judge the 4.7 switch by quality per dollar
- Run your eval set on 4.6 and 4.7 at the same dollar budget.
- If quality doesn't rise with the token increase, keep 4.6 for that task.
Try It
# Run in Claude Code or a terminal (uses Anthropic's token counting API; replace the model IDs yourself)
# pip install anthropic
import anthropic
client = anthropic.Anthropic() # needs ANTHROPIC_API_KEY env var
text = open("prompt.txt", encoding="utf-8").read()
models = ["{{old model ID}}", "{{new model ID}}"]
counts = {}
for m in models:
r = client.messages.count_tokens(
model=m,
messages=[{"role": "user", "content": text}],
)
counts[m] = r.input_tokens
print(m, r.input_tokens)
print("ratio:", counts[models[1]] / counts[models[0]])Terminology
Related Papers
Claude Code regularly sends each background agent’s transcript to its model
Disabling Claude Code's 30-second agent status summaries removed 19.7% of API requests in one team's telemetry
Cross-request KV cache exposure in the GLM-5.3 Workers AI model (155 responses)
A KV pool smaller than the context window leaked other customers' data into 155 long-prompt responses.
Microsoft Decision-1: 9B Qwen Model Launch Explained
Microsoft's 9B Qwen-based model returns only per-option probabilities for routing and classification.
Cerebras Deploys Trillion-Parameter AI Models
Cerebras fits Kimi K3 (3T) across 59 wafers in a pipeline, serving 1000-2000+ tokens per second
A practical guide to AI image generation, from diffusion to agents
Testing image APIs showed you pay per canvas, and camera-style prompts beat describing the view
DeepInfer: High-performance inference framework for DeepSeek models
DeepSeek open-sourced DeepInfer, its production inference engine, under Apache-2.0.
Mercury 3: Diffusion at scale
Scaling diffusion LLM 40x gives Mercury 3: 4–8x faster than speed-tier models, similar quality
DeepSeek banned from U.S. federal civilian agencies under new DHS order
DHS order bans DeepSeek from U.S. federal civilian agency IT systems