AI model API cost comparison (Claude, GPT, Gemini)
What your API usage costs with each Anthropic, OpenAI and Google model, with caching and discounts, ranked from cheapest to dearest.
Calculator inputs
Results
Enter your values and press “Calculate” to see the result.
| Provider | Model | Cost per 1,000 requests | Cost for the period | Times the cheapest |
|---|---|---|---|---|
| OpenAI | GPT-5 nano | 0.3 | 9 | 1 |
| Gemini 2.5 Flash-Lite | 0.4 | 12 | 1.3 | |
| Anthropic | Claude Haiku 5.5 (hasta 100k) | 0.45 | 13.5 | 1.5 |
| OpenAI | GPT-6 Luna | 0.45 | 13.5 | 1.5 |
| OpenAI | GPT-4o mini | 0.6 | 18 | 2 |
| OpenAI | GPT-5.4 nano | 1.025 | 30.75 | 3.4 |
| Gemini 3.1 Flash-Lite | 1.25 | 37.5 | 4.2 | |
| OpenAI | GPT-5 mini | 1.5 | 45 | 5 |
| Gemini 3.5 Flash-Lite | 1.85 | 55.5 | 6.2 | |
| Gemini 2.5 Flash | 1.85 | 55.5 | 6.2 | |
| Gemini 3.8 Flash | 3.375 | 101.25 | 11.3 | |
| OpenAI | GPT-5.4 mini | 3.75 | 112.5 | 12.5 |
| Anthropic | Claude Haiku 4.5 | 4.5 | 135 | 15 |
| Gemini 3.5 Flash | 7.5 | 225 | 25 | |
| Gemini 2.5 Pro (hasta 200k) | 7.5 | 225 | 25 | |
| OpenAI | GPT-4.1 | 8 | 240 | 26.7 |
| OpenAI | o3 | 8 | 240 | 26.7 |
| Anthropic | Claude Sonnet 5.5 | 9 | 270 | 30 |
| OpenAI | GPT-6.1 Sol | 9 | 270 | 30 |
| Gemini 3.1 Pro (hasta 200k) | 10 | 300 | 33.3 | |
| OpenAI | GPT-5.4 | 12.5 | 375 | 41.7 |
| Anthropic | Claude Sonnet 4.6 | 13.5 | 405 | 45 |
| Anthropic | Claude Opus 5.5 | 18 | 540 | 60 |
| Anthropic | Claude Opus 5 | 22.5 | 675 | 75 |
| OpenAI | GPT-5.5 | 25 | 750 | 83.3 |
| Anthropic | Claude Fable 5.1 | 45 | 1,350 | 150 |
| OpenAI | GPT-6 Astra | 45 | 1,350 | 150 |
See the working step by step
- Cost per request = 0.009000 USD
Data updated 2026-10-07 · Indicative result: it does not replace professional advice
In short
- What it calculates
- What your API usage costs with each Anthropic, OpenAI and Google model, with caching and discounts, ranked from cheapest to dearest.
- Formula used
Cost per request = [ input tokens × (1 − c) × input price + input tokens × c × cache price + output tokens × output price ] ÷ 1,000,000 × (1 − discount)- Example
- Example 1. An assistant with a thousand queries a day.
AI model cost comparison calculator
Choosing a language model by reputation, without looking at cost, can multiply your application’s bill by ten or a hundred: the gap between a small and a large model is often two orders of magnitude. But the cheapest model is not always good enough: what matters is the cost per task solved.
Enter how many requests you make, how many tokens you send and receive on each and, if you like, what share of the input goes to the cache and what discount you apply. You will see the cost with your model, its price rank among Anthropic, OpenAI and Google models, and a table with all of them from cheapest to dearest. Everything runs in your browser.
How it works
Providers charge per million tokens, with one price for input and a higher one for output. The cost of a request is: input tokens × input price + output tokens × output price, all divided by a million.
If you use prompt caching, the part of the input read from the cache is billed at a much lower rate (often a tenth or less). An extra discount (for example the batch API’s) applies to the total. The cost for the period is one request’s cost times the requests a day times the days.
Formula
Cost per request = [ input tokens × (1 − c) × input price + input tokens × c × cache price + output tokens × output price ] ÷ 1,000,000 × (1 − discount)
c = fraction of the input served from the cache (with no cache price, full input is charged)
Cost for the period = cost per request × requests per day × days
Times dearer = model’s cost ÷ cheapest’s cost
Worked example
Example 1. An assistant with a thousand queries a day.
With 1,000 requests a day, 2,000 input tokens and 500 output tokens for 30 days (75 million tokens), Claude Sonnet 5.5 costs $270 a month ($9 per thousand requests), 18th of 27 by price. The cheapest on the list costs $9 a month: 30 times less. The dearest for this profile, $1,350 a month (150 times).
Example 2. Using the cache.
With the same figures but 80% of the input served from the cache, Claude Sonnet 5.5 falls to $178.80 a month (34% less), because on this model cached input costs a twentieth ($0.10 against $2 per million).
Example 3. A batch discount.
With 2,000 requests a day, 1,500 input tokens, 800 output tokens and a 20% discount, GPT-5.4 costs $756 a month ($12.60 per thousand requests).
Explanation
What you pay for in a language API
You pay for tokens, not requests. A token is a chunk of text (in English, about four characters). What you send (input) and what the model generates (output) are charged separately, and output usually costs four to six times more.
How to cut the cost
- **Pick the smallest model that does the job well**: the price gap between small and large models is huge.
- **Use prompt caching** if you repeat long instructions or documents.
- **Use the batch API** for work that does not need an immediate answer (it often gives a 50% discount).
- **Limit the output**: ask for concise answers and cap the maximum tokens.
- **Trim the context**: do not send the whole history if you do not need to.
Price is not the same as cost per task
A cheap model that fails half the time and forces retries can end up dearer than a better one. Measure the cost per task solved with your own examples before deciding.
Tokens are not the same across providers
Each provider has its own tokenizer: the same text gives a different number of tokens depending on the model (in recent versions of some models, up to 30% more than earlier ones). If you compare models from different providers, measure real tokens with each one’s counter.
Common mistakes
- Comparing models only on input price, forgetting that output costs more.
- Forgetting the “reasoning” tokens of models that think before replying, which are billed as output.
- Not counting the conversation history, which is resent on every call.
- Trusting old prices: they change often.
Limits of this calculator
- It uses each model’s standard price (no batch or volume discounts, apart from what you enter) and, for Google models with tiered pricing, the up-to-200,000-token tier.
- Google’s cache price is not listed, so no cache saving is applied to those models; cache-write cost and storage are not included.
- It does not include separately charged tools (web search, code execution), images, audio or video, or fine-tuning.
- OpenAI and Google prices were taken from their pages with a tool that summarises the content: check them on the official page before deciding.
- Prices change: the revision date appears next to the result.
Notice
This is an estimate. Rates are set by each provider and can change without notice; confirm the current price before budgeting.
Frequently asked questions
How is the cost of an API call calculated?
Multiply input tokens by their price and output tokens by theirs, then divide by a million. Output usually costs four to six times more than input.
What is a token?
A chunk of text: in English, about four characters or three quarters of a word. In other languages there are usually somewhat more tokens per word.
What is prompt caching?
A feature that reuses the processing of a repeated prefix (instructions, documents) and bills it much cheaper. If you repeat a long context, it can cut the bill noticeably.
Is the cheapest model the best?
Not necessarily. What matters is the cost per task solved: a cheap model that fails and forces retries can end up dearer.
Why do tokens differ between providers?
Each uses its own tokenizer: the same text gives different counts. To compare precisely, measure tokens with each provider’s tool.
Does it include the batch API discount?
You can apply it with the “Extra discount” field (batch APIs usually give 50%). The calculator does not assume it by default.
How often are prices updated?
They are checked on the date shown next to the result, but providers change rates often: confirm the price on their page before deciding.
Is my data sent to a server?
No. The calculation runs in your browser.
Sources and references
The formula behind this calculator is not ours. These are the sources it comes from, in APA 7 format, in case you want to go to the original or cite them in your own work.
- Anthropic. (2026). Pricing. Claude Developer Platform. Consultado el 7 de octubre de 2026, de https://platform.claude.com/docs/en/about-claude/pricing https://platform.claude.com/docs/en/about-claude/pricing Claude model prices and prompt-caching prices.
- OpenAI. (2026). API pricing. Consultado el 7 de octubre de 2026, de https://developers.openai.com/api/docs/pricing https://developers.openai.com/api/docs/pricing OpenAI model prices (standard tier).
- Google. (2026). Gemini Developer API pricing. Consultado el 7 de octubre de 2026, de https://ai.google.dev/gemini-api/docs/pricing https://ai.google.dev/gemini-api/docs/pricing Gemini model prices (paid tier).
Need to calculate something else?
These tools are often used alongside this calculator.
Token cost
What each request to a language model costs and the monthly bill, with prompt caching, reasoning tokens and…
API cost
Monthly and annual spend on an API with a fixed fee and volume pricing, to compare up to three plans and see…
ROI
Measure the percentage return of any investment or campaign.
Context window
Check whether your text fits in the context window of Claude, GPT or Gemini and how much of it you use…