Runs entirely in your browser. Nothing you enter is sent anywhere or saved. Prices are US dollars per million tokens on each vendor's standard tier, checked 13 November 2026; batch and priority tiers are not included.
The formula
For each turn t from 1 to T (the number of turns), with S the system prompt, U the customer message and O the reply, all in tokens:
Here cached, write and output are the cached input, cache write and output prices per million tokens. With caching on, the calculator assumes every uncached input token is written to the cache for the next turn.
When a turn's input goes over a model's long-context threshold, the calculator applies that model's long-context prices to the turn. The thresholds come from the same pricing pages:
| Model | Long-context rule | Source |
|---|---|---|
| GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna | Over 272K input tokens: 2x input and cached input, 1.5x output | OpenAI pricing |
| Claude Haiku 5.5 | Prompts over 100K tokens: $0.50 input, $2.50 output (from $0.10 and $0.50) | Anthropic pricing |
| Grok 4.7 | 200k tokens or more: $4 input, $12 output (from $2 and $6) | xAI Grok 4.7 |
| Muse Ember | Over 200K tokens: $0.30 input, $1.50 output (from $0.10 and $0.50) | Meta pricing |
A worked example
These inputs are examples, not benchmarks: 10,000 conversations a month, 6 turns each, a 2,000-token system prompt, 300-token customer messages and 400-token replies, with the history resent on every turn, on Claude Opus 5.5 at $4 per million input tokens, $20 per million output tokens, $0.20 for a cache hit and $5 for a 5-minute cache write (Anthropic pricing, checked 13 November 2026).
| Turn | Input tokens | Output tokens | Cost without caching | Cost with 50% cache hits |
|---|---|---|---|---|
| 1 | 2,300 | 400 | $0.0172 | $0.01398 |
| 2 | 3,000 | 400 | $0.0200 | $0.01580 |
| 3 | 3,700 | 400 | $0.0228 | $0.01762 |
| 4 | 4,400 | 400 | $0.0256 | $0.01944 |
| 5 | 5,100 | 400 | $0.0284 | $0.02126 |
| 6 | 5,800 | 400 | $0.0312 | $0.02308 |
| Conversation | 24,300 | 2,400 | $0.1452 | $0.11118 |
| Month (× 10,000) | 243 million | 24 million | $1,452 | $1,111.80 |
With caching on, the input price per million tokens is 0.5 × $0.20 + 0.5 × $5 = $2.60 instead of $4. In this example 84% of all input tokens repeat earlier turns, so a 50% hit rate is possible; the calculator warns you if the hit rate you enter is higher than the repeated share.
What the calculator leaves out
- Batch discounts. Live chat replies cannot wait for a batch, so the calculator prices the standard tier. Offline jobs such as evaluation runs can go through a batch API at 50% off on Anthropic, OpenAI and Google; see cost control.
- Tool and search fees. Web search and other server-side tools are charged per call on top of tokens. The per-call prices are in the API pricing table.
- Different tokenizers. The same text produces different token counts on different models. Anthropic's pricing page says the tokenizer in Claude 4.7 and later models produces about 30% more tokens for the same text than its earlier tokenizer, so measure real token counts from your logs.
- Regional and priority surcharges. OpenAI's regional processing adds 10%, Anthropic's US-only inference costs 1.1x, and xAI's US regional endpoint costs 1.1x, according to their pricing pages.
Next step
Put last month's real figures into the calculator, then compare a cheaper model for your easiest intents. The routing guide shows the price gap between each vendor's large and small models.
Frequently asked questions
- Why does each turn cost more than the one before?
- Chat APIs do not remember earlier turns on their own, so a typical chat system sends the system prompt and the whole conversation so far with every new message. In the example on this page, the first turn sends 2,300 input tokens and the sixth sends 5,800. Untick "Resend the conversation history" if your system sends only the latest message.
- Why is uncached input priced at the cache-write price?
- When caching is on, the part of the prompt that is not read from the cache is written to it so the next turn can reuse it. Anthropic charges 1.25x the input price for a 5-minute cache write and OpenAI charges 1.25x for its default 30-minute write. Google, Mistral, xAI and Meta list a cached-input price but no cache-write price for these models, so for them the calculator uses the normal input price.
- What hit rate should I enter?
- Use the cached-token counts from your own API usage reports. The calculator shows how much of your input is repeated from earlier turns, which is the most a cache could serve. Anthropic's batch docs report cache hit rates of 30 to 98 percent inside batches, depending on traffic patterns, which shows how widely real rates vary.