1 · Token estimation
Each model uses a specific tokenizer, and each tokenizer packs characters into tokens at a different density. We maintain measured density profiles rather than one lazy average:
| Tokenizer | Latin | CJK | Code | Chars / token |
|---|---|---|---|---|
| cl100k_base | 4 | 1.5 | 2.5 | per script mix |
| o200k_base | 4 | 1.5 | 2.5 | per script mix |
| Claude BPE | 4 | 1.4 | 2.5 | per script mix |
| SentencePiece | 3.7 | 1.3 | 2.4 | per script mix |
| Llama BPE | 4 | 1.5 | 2.5 | per script mix |
Your text is analysed script-by-script (Latin, CJK, code, Arabic, Devanagari) and each segment contributes tokens at its own density — so a mixed English/Chinese/code prompt gets a far better estimate than any single-ratio rule of thumb.
2 · Cost computation
Costs are computed from each model's official rates:
input cost = input tokens × input price ÷ 1,000,000, likewise for output. On top of the
base we apply the provider's real discount mechanics:
- Prompt caching — your cache-hit percentage bills reads at the model's cached-input rate.
- Batch mode — models that support async batching get their documented discount.
- Reasoning tokens — reasoning models bill hidden thinking tokens as output, scaled by effort level.
- Tiered pricing — models with higher rates above a context threshold switch tiers automatically.
- Multimodal — images use OpenAI's tiling math or flat-rate equivalents; audio uses per-second token rates.
The same engine powers this website's calculator and every static number on the comparison pages.
3 · Pricing data sources
Rates are verified by hand against each provider's official pricing page, then kept fresh by an automated sync workflow. Last full verification: August 20, 2026. Official sources:
- OpenAI — official pricing ↗
- Anthropic — official pricing ↗
- Google — official pricing ↗
- Mistral — official pricing ↗
- Meta / Llama — official pricing ↗
- xAI / Grok — official pricing ↗
- MiniMax — official pricing ↗
- Moonshot / Kimi — official pricing ↗
- DeepSeek — official pricing ↗
4 · Limitations (the honest part)
- Token counts are estimates — expect roughly ±5% on typical prose versus exact tokenizer output.
- Promotional rates, enterprise discounts, taxes and FX conversion are out of scope.
- Fine-tuned and regional model variants may be priced differently from their base models.
- Providers change prices without notice — always confirm before committing budgets.
Spotted something off? It's a static site built to be corrected fast — the pricing registry lives in one reviewed file and updates ship within hours.