How the cost of an API call is calculated
Providers bill input (prompt) tokens and output (response) tokens separately, priced per million tokens:
Two adjustments matter in practice. Cached input: a prompt prefix the provider has cached is billed at a much lower rate. Long-context tiers: some models charge more for the whole request once the prompt passes a threshold, for example above 100,000 tokens on Claude Haiku 5.5, 200,000 on Gemini 2.5 Pro and Grok, and 272,000 on recent GPT models. The calculator applies both automatically.
Worked example
A prompt of 2,000 tokens with a 500-token answer on GPT-5.6 Terra ($2 input, $12 output per 1M tokens):
The same 2,000 OpenAI tokens are about 2,600 tokens on Claude Sonnet 5.5, because its tokenizer splits text more finely, so comparing models by price per token alone understates Claude's cost.
How tokens are counted here
- OpenAI (GPT-4o, GPT-4.1, GPT-5.x): exact, using the o200k_base byte-pair encoding that these models use, running in your browser. The GPT-6 family is not yet documented and is assumed to use the same encoding.
- Claude: estimated. Anthropic states that Claude 4.7 and later produce about 30% more tokens for the same text than earlier models, so we multiply the o200k count by 1.3 for Fable, Opus, Sonnet and Haiku 5.x and by 1.0 for Sonnet 4.6 and Haiku 4.5.
- Gemini, Grok, DeepSeek, Mistral: estimated from the o200k count. Google gives the rule of thumb of about four characters per token.
Rules of thumb from our own samples with o200k_base: English averages 5.4 characters and 1.12 tokens per word; German 4.6 characters and 1.47 tokens per word. Code, numbers and non-Latin scripts use more tokens per character.
LLM API prices per million tokens
List prices in US dollars, standard tier, as of 2026-10-20. Long-context and dated price changes are noted.
| Model | API id | Input | Cached input | Output | Context |
|---|---|---|---|---|---|
| Claude Fable 5.1 | claude-fable-5-1 | $10 | $0.25 | $50 | 1,000,000 |
| Claude Opus 5.5 | claude-opus-5-5 | $4 | $0.2 | $20 | 1,000,000 |
| Claude Sonnet 5.5 | claude-sonnet-5-5 | $2 | $0.1 | $10 | 1,000,000 |
| Claude Haiku 5.5 > 100,000 tokens: $0.5 / $2.5 Higher price for prompts over 100k tokens | claude-haiku-5-5 | $0.1 | $0.01 | $0.5 | 1,000,000 |
| Claude Sonnet 4.6 | claude-sonnet-4-6 | $3 | $0.3 | $15 | 1,000,000 |
| Claude Haiku 4.5 | claude-haiku-4-5-20251001 | $1 | $0.1 | $5 | 200,000 |
| GPT-6 Astra > 272,000 tokens: $20 / $75 | gpt-6-astra | $10 | $1 | $50 | 1,050,000 |
| GPT-6.1 Sol > 272,000 tokens: $4 / $15 | gpt-6.1-sol | $2 | $0.1 | $10 | 1,050,000 |
| GPT-6 Sol > 272,000 tokens: $4 / $15 | gpt-6-sol | $2 | $0.2 | $10 | 1,050,000 |
| GPT-6 Luna > 272,000 tokens: $0.2 / $0.75 | gpt-6-luna | $0.1 | $0.01 | $0.5 | 1,050,000 |
| GPT-5.6 Sol > 272,000 tokens: $8 / $30 Promotional price, at least through 21 Nov 2026 | gpt-5.6-sol | $4 | $0.4 | $20 | 1,050,000 |
| GPT-5.6 Terra > 272,000 tokens: $4 / $18 | gpt-5.6-terra | $2 | $0.2 | $12 | 1,050,000 |
| GPT-5.6 Luna > 272,000 tokens: $0.4 / $1.8 | gpt-5.6-luna | $0.2 | $0.02 | $1.2 | 1,050,000 |
| GPT-5.5 > 272,000 tokens: $10 / $45 | gpt-5.5 | $5 | $0.5 | $30 | 1,050,000 |
| GPT-5.4 > 272,000 tokens: $5 / $22.5 | gpt-5.4 | $2.5 | $0.25 | $15 | 1,050,000 |
| GPT-5.4 mini | gpt-5.4-mini | $0.75 | $0.075 | $4.5 | 400,000 |
| GPT-4.1 | gpt-4.1 | $2 | $0.5 | $8 | 1,047,576 |
| GPT-4o | gpt-4o | $2.5 | $1.25 | $10 | 128,000 |
| GPT-4o mini | gpt-4o-mini | $0.15 | $0.075 | $0.6 | 128,000 |
| Gemini 4 Argon from 2026-12-01: $4 / $20 | gemini-4-argon | $2 | $0.1 | $10 | 1,048,576 |
| Gemini 3.8 Flash from 2027-01-01: $1.5 / $7.5 | gemini-3.8-flash | $0.75 | $0.075 | $3.75 | 1,048,576 |
| Gemini 3.6 Flash from 2027-01-01: $1.5 / $7.5 | gemini-3.6-flash | $0.75 | $0.075 | $3.75 | 1,048,576 |
| Gemini 3.5 Flash-Lite | gemini-3.5-flash-lite | $0.3 | $0.03 | $2.5 | 1,048,576 |
| Gemini 3.1 Flash-Lite | gemini-3.1-flash-lite | $0.25 | $0.025 | $1.5 | 1,048,576 |
| Gemini 3.1 Pro Preview > 200,000 tokens: $4 / $18 Preview model | gemini-3.1-pro-preview | $2 | $0.2 | $12 | 1,048,576 |
| Gemini 2.5 Pro > 200,000 tokens: $2.5 / $15 Limited to existing users | gemini-2.5-pro | $1.25 | $0.125 | $10 | 1,048,576 |
| Gemini 2.5 Flash Limited to existing users | gemini-2.5-flash | $0.3 | $0.03 | $2.5 | 1,048,576 |
| Gemini 2.5 Flash-Lite Limited to existing users | gemini-2.5-flash-lite | $0.1 | $0.01 | $0.4 | 1,048,576 |
| Grok 4.7 >= 200,000 tokens: $4 / $12 | grok-4.7 | $2 | $0.5 | $6 | 500,000 |
| Grok 4.3 >= 200,000 tokens: $2.5 / $5 | grok-4.3 | $1.25 | $0.2 | $2.5 | 1,000,000 |
| DeepSeek V4.1 Flash | deepseek-flash | $0.3 | $0.006 | $1.2 | 1,000,000 |
| DeepSeek V4 Pro | deepseek-v4-pro | $1.32 | $0.044 | $3.96 | 1,000,000 |
| Mistral Medium 3.5 | mistral-medium-3-5 | $1.5 | — | $7.5 | 256,000 |
| Mistral Small 4 | mistral-small-2603 | $0.15 | — | $0.6 | 256,000 |
Frequently asked questions
What is a token?
A token is the unit a language model reads and writes: a whole word, part of a word, a number or a punctuation mark. With OpenAI's o200k_base tokenizer, ordinary English text averages about 5.4 characters per token, or 1.12 tokens per word in our sample.
How many tokens is 1,000 words?
About 1,120 tokens for English text with OpenAI's tokenizer, more for German (about 1,470 in our sample) and roughly 30% more again for Claude 4.7 and later models, whose tokenizer splits text more finely.
Why are Claude and Gemini counts marked as estimates?
Anthropic and Google do not publish a tokenizer that runs in the browser, so their counts here are estimated from the o200k_base count. For Claude 4.7 and later we multiply by 1.3, because Anthropic states the newer tokenizer produces about 30% more tokens. For exact numbers, both providers offer a free token-counting API endpoint.
Is my text sent anywhere?
No. The tokenizer is downloaded once and runs entirely in your browser. Nothing you paste is uploaded to numlane or to any AI provider.
Why do output tokens cost more than input tokens?
Generating text takes far more computation per token than reading it, so every provider charges a multiple of the input price for output, typically four to eight times. Long answers and reasoning-heavy models therefore dominate the bill.
Which model is the cheapest for my prompt?
For the sample prompt above with 500 output tokens, Gemini 2.5 Flash-Lite is cheapest at $0.000208 per call, and Claude Fable 5.1 the most expensive at $0.0261. Paste your own prompt to see the ranking change.
What are cached input tokens?
If you send the same long prefix repeatedly (a system prompt, a document), providers can serve it from a cache and bill it at a fraction of the normal input price. Use the cached-input setting to see the effect; how much of your prompt is cached depends on the provider's caching rules.
Does the counter include images, audio or tool definitions?
No. It counts the text you paste. Images, audio, video and tool schemas are tokenized by each provider with their own rules and add to the bill separately.
Sources
- Anthropic: Pricing — checked 2026-10-20
- Anthropic: Token counting
- OpenAI: API pricing — checked 2026-10-20
- Google: Gemini API pricing — checked 2026-10-20
- Google: Understand and count tokens
- xAI: Models and pricing
- DeepSeek: Models & pricing
- Mistral: Pricing
- gpt-tokenizer (o200k_base implementation used in the browser)
Information, not legal, tax or financial advice. Check the official sources linked on each page.