LLM API Cost Calculator
Estimate the cost of GPT, Claude, and Gemini API calls from token counts, and compare pricing across models.
Model
Input tokens
Output tokens
Requests per month
req/mo
Cost per Request
$0.000450
Input Cost
$0.000150
Output Cost
$0.000300
Monthly cost at 10,000 requests
$4.50
Compare across models
| Model | Per 1M (in/out) | Cost / Request | Monthly Cost |
|---|---|---|---|
| Google — Gemini 2.5 Flash-Lite | $0.1 / $0.4 | $0.000300 | $3.00 |
| OpenAI — GPT-4o mini | $0.15 / $0.6 | $0.000450 | $4.50 |
| Google — Gemini 2.5 Flash | $0.3 / $2.5 | $0.001550 | $15.50 |
| Anthropic — Claude Haiku 4.5 | $1 / $5 | $0.003500 | $35.00 |
| OpenAI — GPT-4.1 | $2 / $8 | $0.006000 | $60.00 |
| Google — Gemini 2.5 Pro (≤200K) | $1.25 / $10 | $0.006250 | $62.50 |
| OpenAI — GPT-4o | $2.5 / $10 | $0.007500 | $75.00 |
| Anthropic — Claude Sonnet 5 | $3 / $15 | $0.0105 | $105.00 |
| Anthropic — Claude Opus 5 | $5 / $25 | $0.0175 | $175.00 |
| Anthropic — Claude Fable 5 | $10 / $50 | $0.035 | $350.00 |
How LLM API pricing works
Most LLM providers charge separately for input tokens (the prompt, context, and any retrieved documents you send) and output tokens (what the model generates back). Output tokens are almost always priced higher than input tokens because generation is more compute-intensive than reading. A token is roughly 4 characters or about 0.75 words of English text, though this varies by model and language.
Ways to reduce LLM API costs
Prompt caching — most providers now discount repeated context (system prompts, long documents) by 50-90% on cache hits.
Batch APIs — OpenAI and Anthropic both offer ~50% discounts for non-real-time batch processing.
Right-size the model — smaller models (GPT-4o mini, Gemini Flash-Lite, Claude Haiku) cost 10-50x less than flagship models and are often good enough for classification, extraction, or summarization tasks.
Trim context — every token of unnecessary context in a long conversation history gets re-billed on every turn.
FAQs
Is this pricing accurate?
These figures are approximate, checked against provider documentation as of August 2026. AI API pricing changes frequently — always confirm current rates on the provider's official pricing page before budgeting or billing a customer.
How accurate is the token estimate from pasted text?
The ~4-characters-per-token estimate is a common rule of thumb for English text, but actual tokenizers differ per model family and count non-English text, code, and whitespace differently. For exact counts, use the provider's official tokenizer.
