AI APIs bill by the token, with separate prices for input, output, cached input and, on Claude, cache writes. This calculator turns your text or token counts into an estimated cost per request, per day and per month, so you can compare models before you build. Prices were checked against each provider’s official pricing page on 22 October 2026. They change often, so confirm on the provider page before you set a budget.
How do I use this tool?
- Paste your prompt to get an estimated token count, or type exact input and output token counts if you have them.
- Enter the expected output length in tokens.
- If you use prompt caching, enter the share of input tokens read from cache and the share written to cache. For Claude models, choose a 5-minute or 1-hour cache duration.
- Enter requests per day. The tool multiplies by 30 for a monthly figure.
- Choose providers, tick Use the Batch API if the work can wait, and open older models only if you need them. The table lists matching models, sorted by monthly cost.
How is the cost worked out?
Each request’s input splits into three parts: uncached tokens, cache reads and cache writes. Their shares add up to 100% of the input tokens.
Cost per request = (uncached input x input price + cache reads x cache read price + cache writes x cache write price + output x output price) / 1,000,000. Prices are in US dollars per million tokens (MTok).
- Claude cache writes cost 1.25 times the input price for a 5-minute write and 2 times for a 1-hour write. The Anthropic pricing page lists the exact figure for each model, and the calculator uses it.
- OpenAI and Google list no separate cache-write price, so written tokens are billed at the normal input rate. Google also bills context cache storage per hour, which this calculator does not include.
- Batch halves the cost of input, output and cache usage. Anthropic, OpenAI and Google each list batch prices at half the standard rate.
- Totals: daily cost = cost per request x requests per day. Monthly cost = daily cost x 30.
| Model | Input / MTok | Cache read / MTok | Cache write / MTok (5 min / 1 hour) | Output / MTok |
|---|---|---|---|---|
| Claude Fable 5.1 | $10 | $0.25 | $12.50 / $20 | $50 |
| Claude Opus 5.5 | $4 | $0.20 | $5 / $8 | $20 |
| Claude Sonnet 5.5 | $2 | $0.10 | $2.50 / $4 | $10 |
| Claude Haiku 5.5 (prompt up to 100k tokens) | $0.10 | $0.01 | $0.125 / $0.20 | $0.50 |
| GPT-6 Astra (up to 272k tokens) | $10 | $1 | Not listed, billed at input rate | $50 |
| GPT-6.1 Sol (up to 272k tokens) | $2 | $0.10 | Not listed, billed at input rate | $10 |
| Gemini 4 Argon (until 30 Nov 2026) | $2 | $0.10 | Not listed, billed at input rate | $10 |
| Gemini 3.8 Flash (until 31 Dec 2026) | $0.75 | $0.075 | Not listed, billed at input rate | $3.75 |
Sources: Anthropic pricing, OpenAI API pricing and Gemini API pricing. Some models switch to higher rates above a prompt length threshold, and two Gemini models have announced price rises; the calculator applies these automatically. Claude Mythos models are limited availability and are not listed. Retired Claude models are not listed either.
Worked example: no caching
A support bot sends 3,000 input tokens and gets 500 output tokens back, 1,000 times a day, on Claude Sonnet 5.5 with no caching.
- Input: 3,000 x $2 / 1,000,000 = $0.006
- Output: 500 x $10 / 1,000,000 = $0.005
- Per request: $0.011. Per day: $11. Per 30 days: about $330.
Worked example: cache reads and cache writes
Same bot, 3,000 input tokens and 500 output tokens. Half the input (1,500 tokens) is read from cache. A fifth (600 tokens) is written to a 5-minute cache. The remaining 900 tokens are uncached.
- Uncached: 900 x $2 = $1,800
- Cache read: 1,500 x $0.10 = $150
- Cache write: 600 x $2.50 = $1,500
- Output: 500 x $10 = $5,000
- Per request: $8,450 / 1,000,000 = $0.00845. Per day: $8.45. Per 30 days: about $253.50.
Without caching the same request costs $0.011, so the cache saves money here once the prefix is reused.
How accurate is the token estimate?
Text estimates are rough. OpenAI says 1 token is about 4 characters or 0.75 words of English text, and Google says the same 4 characters for Gemini. Anthropic says 1M tokens is roughly 2.5M characters on the tokenizer used by Claude Opus 4.7 and later, and that this tokenizer produces about 30% more tokens than older Claude models for the same text. So the calculator uses about 2.5 characters per token for current Claude models, about 4 for OpenAI and Gemini, and a word-based estimate for older Claude models. For exact counts, use the provider tools: Anthropic’s free /v1/messages/count_tokens endpoint, OpenAI’s tokenizer or tiktoken, and Gemini’s countTokens.
Common mistakes
- Ignoring output tokens. Output often costs 5 times the input price or more, so long answers drive the bill.
- Forgetting thinking tokens. Reasoning output is billed as output; Google states this for Gemini.
- Reusing old token counts. Counts from older Claude models can be about 30% low on current ones.
- Leaving out conversation history. In a chat, every earlier turn is sent again as input.
- Treating cache writes as free. Writing to Anthropic’s cache costs 1.25 times normal input for 5 minutes, or 2 times for 1 hour. Caching only pays off when the same prefix is read again.
- Missing long-context prices. Claude Haiku 5.5 charges more above 100,000 prompt tokens, and GPT-6 Astra and other OpenAI models above 272,000.
Tips to cut cost
- Cache long, repeated prefixes such as system prompts and reference documents.
- Use the Batch API for work that can wait; Anthropic, OpenAI and Google each list half price for batch.
- Route simple tasks to a small model and keep the large model for hard ones.
- Cap output length and ask for short formats.
These figures are estimates for planning only, not a quote. Taxes, regional pricing, data residency multipliers, fast or priority tiers and tool fees are not included. If you are planning an AI feature or agent, see our AI automation service, or read what is Claude Code to see how coding agents use tokens.
Last updated: October 22, 2026