Token counter
Paste text to count its tokens, then push the count into the calculator below.
Exact for OpenAI models (tiktoken o200k_base).
Token counts for non-OpenAI providers are estimates. Newer Claude/Gemini models tokenize differently (often ~30% more).
LLM API cost calculator
Cost per call = input×price + output×price (cached input, where supported, is billed at the discounted cache-read rate). Monthly = cost per call × requests.
| Model | Cost / call | Cost / month |
|---|
LLM API pricing comparison (per 1M tokens, USD)
| Provider | Model | Input | Cached input | Output |
|---|---|---|---|---|
| OpenAI | GPT-5.6 Sol | $5.00 | $0.500 | $30.00 |
| OpenAI | GPT-5.6 Terra | $2.50 | $0.250 | $15.00 |
| OpenAI | GPT-5.6 Luna | $1.00 | $0.100 | $6.00 |
| OpenAI | GPT-5.4 mini | $0.750 | $0.075 | $4.50 |
| OpenAI | GPT-5.4 nano | $0.200 | $0.020 | $1.25 |
| Anthropic Claude | Claude Opus 4.8 | $5.00 | $0.500 | $25.00 |
| Anthropic Claude | Claude Sonnet 5ⓘ | $2.00 | $0.200 | $10.00 |
| Anthropic Claude | Claude Haiku 4.5 | $1.00 | $0.100 | $5.00 |
| Anthropic Claude | Claude Fable 5 | $10.00 | $1.00 | $50.00 |
| Google Gemini | Gemini 3.5 Flash | $1.50 | $0.150 | $9.00 |
| Google Gemini | Gemini 3.1 Proⓘ | $2.00 | $0.200 | $12.00 |
| Google Gemini | Gemini 2.5 Proⓘ | $1.25 | $0.125 | $10.00 |
| Google Gemini | Gemini 2.5 Flash | $0.300 | $0.030 | $2.50 |
| Google Gemini | Gemini 2.5 Flash-Lite | $0.100 | $0.010 | $0.400 |
| xAI Grok | Grok 4.5 | $2.00 | — | $6.00 |
| xAI Grok | Grok 4.3 | $1.25 | — | $2.50 |
| DeepSeek | DeepSeek V4 Flash | $0.140 | $0.0028 | $0.280 |
| DeepSeek | DeepSeek V4 Pro | $0.435 | $0.0036 | $0.870 |
| Mistral AI | Mistral Large 3 | $0.500 | — | $1.50 |
| Mistral AI | Mistral Medium 3.5 | $1.50 | — | $7.50 |
| Mistral AI | Mistral Small 3 | $0.100 | — | $0.300 |
| Mistral AI | Ministral 3B | $0.040 | — | $0.040 |
| Groq | Llama 3.3 70B Versatile | $0.590 | — | $0.790 |
| Groq | Llama 3.1 8B Instant | $0.050 | — | $0.080 |
| Groq | GPT-OSS 120B | $0.150 | — | $0.600 |
| Groq | Qwen3 32B | $0.290 | — | $0.590 |
Verified 2026-07-11 from OpenAI · Anthropic Claude · Google Gemini · xAI Grok · DeepSeek · Mistral AI · Groq. LLM API prices change often. These figures were verified against official pricing pages on the date above — always confirm with the provider before relying on them for budgeting.
❓ Frequently asked questions
How accurate are the token counts?
Token counts are exact for OpenAI models — we run OpenAI's o200k_base tokenizer (the same BPE used by GPT-4o/4.1/5) locally in your browser. Other providers don't publish browser-ready tokenizers, so their counts are close estimates; newer Claude and Gemini models in particular tokenize the same text into ~30% more tokens.
Is my text sent anywhere?
No. Tokenizing and cost math run entirely in your browser. Nothing you paste is uploaded or stored.
How current is the pricing?
Prices were verified on 2026-07-11 against each provider's official pricing page (linked under the table). LLM prices change often, so confirm with the provider before committing a budget.
What about cached input and batch discounts?
The calculator supports a cached-input field where the provider offers prompt-cache pricing (OpenAI, Anthropic, Gemini, DeepSeek). Batch APIs (typically ~50% off) aren't applied automatically — halve the result if you use batch.