AI API Cost Calculator (GPT-4o, Claude, Gemini, DeepSeek)
Estimate monthly LLM API cost across GPT-4o, Claude 3.5, Gemini, DeepSeek and 100+ models. Compare providers side-by-side with prompt-caching and batch discounts. Free, no signup — prices refreshed daily from the public LiteLLM catalog.
Last updated:
CommentsEstimate the cost of an OpenAI / Anthropic / Google API call by choosing a model and entering token counts (input, output, cache read, batch). Compare multiple models side-by-side. Pricing is fetched daily from the public LiteLLM catalog.
Token counts are estimated locally (±3% vs official tokenizers). Text is never sent to any server.
Cheapest option at this workload
| Model | Per request | |||||
|---|---|---|---|---|---|---|
openaiGPT-5 nano | $0.050/M | $0.400/M | $0.000084 | $2.51 | 272K | |
googleGemini 2.5 Flash Lite | $0.100/M | $0.400/M | $0.000088 | $2.63 | 1049K | |
deepseekDeepSeek (chat) | $0.280/M | $0.420/M | $0.000105 | $3.14 | 131K | |
deepseekDeepSeek (reasoner) | $0.280/M | $0.420/M | $0.000105 | $3.14 | 131K | |
anthropicClaude Haiku 5.5 | $0.100/M | $0.500/M | $0.000108 | $3.24 | 1000K | |
mistralMistral Small | $0.150/M | $0.600/M | $0.000131 | $3.93 | 262K | |
openaiGPT-4o mini | $0.150/M | $0.600/M | $0.000131 | $3.93 | 128K | |
metaLlama-4-Scout-17B-16E (Together) | $0.180/M | $0.590/M | $0.000131 | $3.94 | 1049K | |
mistralCodestral | $0.300/M | $0.900/M | $0.000202 | $6.07 | 128K | |
deepseekDeepSeek V4 Flash | $0.300/M | $1.20/M | $0.000262 | $7.87 | 1000K | |
openaiGPT-5.4 nano | $0.200/M | $1.25/M | $0.000265 | $7.94 | 272K | |
metaLlama-3.3-70B (Together) | $1.04/M | $1.04/M | $0.000285 | $8.55 | 131K | |
openaiGPT-4.1 mini | $0.400/M | $1.60/M | $0.000350 | $10.49 | 1048K | |
openaiGPT-5 mini | $0.250/M | $2.00/M | $0.000419 | $12.56 | 272K | |
mistralDevstral | $0.400/M | $2.00/M | $0.000430 | $12.89 | 256K | |
mistralMistral Large | $0.700/M | $2.10/M | $0.000472 | $14.15 | 1049K | |
googleGemini 2.5 Flash | $0.300/M | $2.50/M | $0.000523 | $15.68 | 1049K | |
googleGemini 3.5 Flash Lite | $0.300/M | $2.50/M | $0.000523 | $15.68 | 1049K | |
googleGemini 3.8 Flash | $0.750/M | $3.75/M | $0.000807 | $24.21 | 1049K | |
deepseekDeepSeek V4 Pro | $1.32/M | $3.96/M | $0.000890 | $26.69 | 1000K | |
openaiGPT-5.4 mini | $0.750/M | $4.50/M | $0.000956 | $28.67 | 272K | |
openaio4-mini | $1.10/M | $4.40/M | $0.000961 | $28.84 | 200K | |
anthropicClaude Haiku 4.5 | $1.00/M | $5.00/M | $0.001079 | $32.37 | 200K | |
xaiGrok 4.5 | $2.00/M | $6.00/M | $0.001348 | $40.44 | 500K | |
xaiGrok 4.6 | $2.00/M | $6.00/M | $0.001348 | $40.44 | 500K | |
xaiGrok 4.7 | $2.00/M | $6.00/M | $0.001348 | $40.44 | 500K | |
mistralMistral Medium 3.5 | $1.50/M | $7.50/M | $0.001611 | $48.33 | 262K | |
openaiGPT-4.1 | $2.00/M | $8.00/M | $0.001748 | $52.44 | 1048K | |
openaio3 | $2.00/M | $8.00/M | $0.001748 | $52.44 | 200K | |
googleGemini 3.5 Flash | $1.50/M | $9.00/M | $0.001914 | $57.42 | 1049K | |
openaiGPT-5 | $1.25/M | $10.00/M | $0.002093 | $62.78 | 272K | |
googleGemini 2.5 Pro | $1.25/M | $10.00/M | $0.002095 | $62.85 | 1049K | |
anthropicClaude Sonnet 5 | $2.00/M | $10.00/M | $0.002158 | $64.74 | 1000K | |
anthropicClaude Sonnet 5.5 | $2.00/M | $10.00/M | $0.002158 | $64.74 | 1000K | |
openaiGPT-4o | $2.50/M | $10.00/M | $0.002185 | $65.55 | 128K | |
googleGemini 3.1 Pro | $2.00/M | $12.00/M | $0.002552 | $76.56 | 1049K | |
openaiGPT-5.4 | $2.50/M | $15.00/M | $0.003185 | $95.55 | 1050K | |
anthropicClaude Sonnet 4.5 | $3.00/M | $15.00/M | $0.003237 | $97.11 | 200K | |
anthropicClaude Sonnet 4.6 | $3.00/M | $15.00/M | $0.003237 | $97.11 | 1000K | |
anthropicClaude Opus 5.5 | $4.00/M | $20.00/M | $0.004316 | $129 | 1000K | |
anthropicClaude Opus 4.8 | $5.00/M | $25.00/M | $0.005395 | $162 | 1000K | |
anthropicClaude Opus 5 | $5.00/M | $25.00/M | $0.005395 | $162 | 1000K | |
openaiGPT-5.5 | $5.00/M | $30.00/M | $0.006370 | $191 | 1050K | |
openaiGPT-5.6 | $5.00/M | $30.00/M | $0.006370 | $191 | 922K |
litellm· last fetched 7h agoWhat is AI Cost Calculator?
LLM APIs bill per token, and input and output tokens are priced differently — output is usually 3–5× more expensive than input. That makes the true cost of a feature hard to eyeball, especially once prompt caching and the Batch API enter the picture. This calculator lets you pick a model, enter the input, output, cached-read, and batched token counts for a typical request, and see the exact dollar cost — then line up several models side by side so you can choose the cheapest one that meets your quality bar. Prices come from the public LiteLLM model catalog and are refreshed daily, so the numbers track provider changes without manual updates.
How to estimate LLM API cost
- 1Pick the model you're pricing (GPT, Claude, Gemini, etc.).
- 2Enter the tokens for a representative request — input, expected output, and any cached-read or batched tokens.
- 3Read the per-request cost, and add more models to compare them side by side.
- 4Multiply by your expected request volume to project monthly spend.
Key Concepts
- What is a token
- The unit LLMs bill and measure in — roughly 4 characters of English. See the full guide on how tokenization works.
- Prompt caching
- Caching a repeated prompt prefix bills those tokens at a steep discount (often ~10% of input price) on later requests.
- Batch API
- Asynchronous processing at ~50% off, for work that can tolerate results within a target window (often 24h).
Tips & Best Practices
- ▸Input tokens are typically 3-5× cheaper than output tokens; long system prompts hurt total cost most when the response is short.
- ▸Cache reads (Anthropic / OpenAI prompt caching) can cut input cost by 90%+ for repeated system prompts.
- ▸Batch API (OpenAI) is 50% cheaper but responses are delivered asynchronously within 24 hours.
Frequently Asked Questions
Where do the prices come from?
Prices are refreshed daily from the BerriAI/litellm public pricing catalog, which itself mirrors each provider's official pricing page. When our automated fetch fails we fall back to a manually maintained snapshot so the tool never shows blank values.
How accurate is the token count?
Token counts use a fast statistical estimator that matches official tokenizers within ±3% for typical English/code prompts. For billing-critical estimates, verify with the provider's own tokenizer.
Does the calculator support prompt caching and batch discounts?
Yes. Toggle 'Cached input' to price the input tokens at the cache-read rate (available on GPT-4o, Claude 3.5, DeepSeek and others). Toggle 'Batch API' to apply the 50%-off batch rate where the provider supports it.
Is my prompt sent to any server?
No. Token estimation runs entirely in your browser. The tool only fetches the public pricing catalog from our server; your prompt text never leaves the tab.
Try Next
Text Chunker
Split long text into overlapping chunks for embedding and RAG pipelines. Preview recursive, paragraph, sentence, or fixed strategies with live token counts. Runs 100% in your browser.
Related Tools
Prompt Template Tester
Write a prompt with {{variable}} placeholders, fill in values, and preview the final prompt. Detects every variable and flags any you left unfilled. 100% local.
Prompt Diff
Compare two versions of a prompt line by line and see the token delta between them — so you know exactly what changed and whether an edit made the prompt cheaper or more expensive. 100% local.
Embedding Cost Calculator
Estimate the cost of embedding a corpus — pick a model, enter the number of documents and average tokens each, and get the total token count and dollar cost. 100% local.
Vector Storage Calculator
Estimate how much memory or disk your embeddings need — enter vector count, dimensions, and precision (float32/float16/int8/binary) to see raw and indexed size. 100% local.
Prompt Cache Calculator
See how much prompt caching saves you. Enter your cached prefix size, per-request tokens, volume, and hit rate to compare cost with and without caching across models that support it. 100% local.
Batch API Cost Calculator
Compare real-time vs Batch API cost for a bulk job. Enter request count and per-request tokens to see how much the ~50% batch discount saves across models that support it. 100% local.