Skip to content
MAMasterAI Now
Herramientas de IA

LLM API Cost Calculator

Turn a token count and a traffic guess into a real monthly bill. Set the prompt size, the answer size and how many requests you expect, and every priced model is compared side by side.

Se ejecuta por completo en tu navegador: nada de lo que escribes sale de la página.

⚠ Esta herramienta aún no está traducida por completo al Español, así que se muestra la versión en inglés. La traducción está en curso.

Precios actualizados por última vez: 1 de febrero de 2025 Precios de lista de referencia, revisados el 1 de febrero de 2025. No incluyen descuentos por volumen, procesamiento por lotes ni tarifas de horas valle: verifícalos con el proveedor antes de presupuestar.

Coste por modelo

Haz clic en el encabezado de una columna para ordenar.

Coste por modelo
Salida máx.Por díaPor año
GoogleGemini 1.5 FlashMás baratoA million-token context at well under a cent per thousand input tokens.1,0M8,2K0,075 US$0,300 US$0,0003 US$0,30 US$9,00 US$108 US$
Mistral AIMistral Small 3Open weights under Apache 2.0, but also served per token — both options are costed here.128K—0,100 US$0,300 US$0,0004 US$0,35 US$10,50 US$126 US$
GoogleGemini 2.0 FlashSuccessor to 1.5 Flash at a similar price point.1,0M8,2K0,100 US$0,400 US$0,0004 US$0,40 US$12,00 US$144 US$
OpenAIGPT-4o miniCheapest OpenAI model for high-volume classification and extraction.128K16,4K0,150 US$0,600 US$0,0006 US$0,60 US$18,00 US$216 US$
DeepSeekDeepSeek-V3 (deepseek-chat)Open weights and very cheap per token; off-peak discounts also apply.64K8,2K0,270 US$1,100 US$0,0011 US$1,09 US$32,70 US$392 US$
AnthropicClaude 3 HaikuLegacy budget tier with a large context window.200K4,1K0,250 US$1,250 US$0,0011 US$1,13 US$33,75 US$405 US$
OpenAIGPT-3.5 TurboLegacy small model; tokenizes with cl100k_base, not o200k.16,4K4,1K0,500 US$1,500 US$0,0018 US$1,75 US$52,50 US$630 US$
DeepSeekDeepSeek-R1 (deepseek-reasoner)Open-weights reasoning model; long chains of thought are billed as output.64K8,2K0,550 US$2,190 US$0,0022 US$2,20 US$65,85 US$790 US$
AnthropicClaude 3.5 HaikuFast tier; long, repeated prompts gain the most from caching.200K8,2K0,800 US$4,000 US$0,0036 US$3,60 US$108 US$1296 US$
OpenAIo3-miniSmall reasoning model; reasoning tokens count toward the output bill.200K100K1,100 US$4,400 US$0,0044 US$4,40 US$132 US$1584 US$
GoogleGemini 1.5 ProPrompts longer than 128K tokens are billed at a higher tier than the price shown.2,1M8,2K1,250 US$5,000 US$0,0050 US$5,00 US$150 US$1800 US$
Mistral AIMistral Large 2Mistral does not publish a max-output figure for this endpoint.128K—2,000 US$6,000 US$0,0070 US$7,00 US$210 US$2520 US$
OpenAIGPT-4oFlagship multimodal generalist; cached input is billed at 50% of the fresh-input rate.128K16,4K2,500 US$10,000 US$0,01 US$10,00 US$300 US$3600 US$
AnthropicClaude 3.5 SonnetCache reads are about 90% cheaper than fresh input.200K8,2K3,000 US$15,000 US$0,01 US$13,50 US$405 US$4860 US$
OpenAIGPT-4 TurboPrevious flagship generation, and a cl100k_base tokenizer.128K4,1K10,000 US$30,000 US$0,04 US$35,00 US$1050 US$12.600 US$
OpenAIo1Reasoning model: hidden reasoning tokens are billed as output tokens.200K100K15,000 US$60,000 US$0,06 US$60,00 US$1800 US$21.600 US$
AnthropicClaude 3 OpusThe highest output price here — useful as a worst case when planning.200K4,1K15,000 US$75,000 US$0,07 US$67,50 US$2025 US$24.300 US$

Pesos abiertos

  • Meta — Llama 3.1 8B· Autoalojado
  • Meta — Llama 3.1 70B· Autoalojado
  • Meta — Llama 3.1 405B· Autoalojado
  • Alibaba — Qwen2.5 72B· Autoalojado

How LLM API pricing actually works

Every major provider bills the same way: two meters, priced per one million tokens. The input meter counts everything you send — system instructions, conversation history, retrieved documents, the user’s question. The output meter counts everything the model writes back. There is no per-request fee and no per-keystroke fee, which is why a short question with a long answer can cost more than a long question with a short answer.

  • Input tokens are processed in a single parallel pass, which is comparatively cheap per token.
  • Output tokens are produced one at a time, each requiring a read of the model’s memory, so providers price them several times higher than input — usually 3× to 5×.
  • Cached input is a discount on the part of the prompt the provider still has in memory from the previous request. It is the largest single lever on a repetitive workload.
  • Reasoning tokens on o1/o3/R1-class models are billed as output even though you may never see them, which can multiply the output meter unexpectedly.
NotePrices here are list prices, on purpose

The table uses each provider’s published list price and shows the date it was checked. Volume agreements, committed-spend discounts, batch endpoints and off-peak rates all change the real number — confirm with your provider before you commit to a budget.

How to use the calculator

  1. 1Average input tokens per request. Use the token counter on the text you really send, not on the user’s question alone — long system prompts dominate this number in practice.
  2. 2Average output tokens per request. Typical chat answers are 200–600 tokens; summaries and generated documents are far longer.
  3. 3Requests per day. Traffic at the top of your expectation, so the answer is a ceiling rather than an average.
  4. 4Days per month. 30 is the usual accounting convention; use 22 for a weekday-only internal tool.
  5. 5Cached input share. The fraction of the prompt that repeats between calls — a fixed system prompt can be 100% cached, a fresh document 0%.

The table then shows cost per request, per day, per month and per year for every model with a published per-token price. Models without one — open-weight releases you host yourself — are listed separately rather than shown as free, because "no API bill" and "no cost" are not the same thing: with self-hosting you pay for GPU hours instead, and the cost moves from the invoice to the infrastructure.

A worked example you can check by hand

cost per request = (input tokens ÷ 1,000,000 × input price) + (output tokens ÷ 1,000,000 × output price)
The same formula the calculator uses, before the cached-input adjustment.

Take a support assistant that receives 2,000 input tokens (a long system prompt plus history) and writes 500 output tokens, at 1,000 requests per day. With GPT-4o mini at $0.15 per million input and $0.60 per million output: input costs 2,000 ÷ 1,000,000 × 0.15 = $0.0003, output costs 500 ÷ 1,000,000 × 0.60 = $0.0003, so a request is $0.0006 — a little over half a thousandth of a cent. A day of traffic is $0.60 and a 30-day month is about $18.

Run the identical workload through Claude 3.5 Sonnet at $3.00 per million input and $15.00 per million output instead: input becomes $0.006 and output $0.0075, so a request is $0.0135, a day is $13.50 and the month lands near $405. Nothing changed except the model name — a 22× difference on the same product. That gap is the entire reason this page exists: model choice is a product decision with a price tag, and it is better seen before launch than after.

Prompt caching: the one discount worth engineering for

Most prompts repeat themselves. A fixed system prompt, a style guide, a long document the user is asking about — the same tokens arrive on every request. Providers noticed, and now keep part of that prefix in memory so the second request can skip recomputing it. A cache hit is billed far below fresh input: OpenAI charges half the input rate, Anthropic about a tenth, DeepSeek a similar fraction, and the calculator applies whichever figure the provider publishes.

The effect on the worked example is easy to feel. If 80% of those 2,000 input tokens are a stable system prompt and therefore cached, GPT-4o mini input drops from $0.0003 to $0.00018 per request — a 40% cut in the total request cost, achieved by reordering the prompt so the constant part comes first. That ordering matters: a cache only matches a prefix, so one changing word near the beginning invalidates everything after it.

  • Put the stable text first — system instructions and reference documents — and the volatile text last.
  • Caches expire, and providers enforce minimum sizes, so short prompts may not benefit at all.
  • Only some providers price cache writes separately; where they do, the first request of a session costs slightly more.

Where costs hide in a real product

  • Retries and validation loops. A failed JSON parse that triggers a second call is a 100% cost increase on that request, not a 0% one.
  • Agent steps. A tool-using loop of eight steps sends the transcript again on every step, so input tokens grow roughly quadratically through the conversation.
  • Unbounded output. Asking for "a full report" can produce 4,000 tokens where 400 would have done — and output is the expensive meter.
  • Context creep. History that is never trimmed keeps billing the same stale turns over and over.
  • Long-context tiers. Some providers charge a higher rate once the prompt passes a threshold — 128K tokens, for example — so a prompt that just crosses the line can cost more than one twice its size.
  • Development and evaluation. Benchmarking a feature against fifty test prompts on a frontier model can cost more than a week of production traffic on a small one.

How to choose a model with this table

  1. 1Sort by monthly cost and note the cheapest three that plausibly pass your quality bar.
  2. 2Check the context window column against your real prompt size — the cheapest model is useless if your document does not fit, or if the prompt must be truncated to make it fit.
  3. 3Check the max-output column before you design a feature that generates long documents.
  4. 4Prototype on the cheapest candidate first. Most tasks that feel like they need a frontier model are solved by a small one with a better prompt.
  5. 5Re-run the numbers whenever you change the system prompt: a few hundred extra tokens per request multiplies by your traffic, not by your effort.

One caveat worth stating plainly: this page compares list prices. It cannot see your traffic mix, your quality thresholds or the engineering cost of switching providers. Treat the output as a shortlist to argue about, not a decision — and re-check the figures against each provider’s pricing page, which is the link printed next to every model.

Preguntas frecuentes

Are these the prices I will actually be charged?
They are published list prices, checked on the date shown at the top of the table. Volume agreements, committed spend, batch endpoints, off-peak discounts and regional pricing all change the invoice. Use the calculator to compare models and to sanity-check an order of magnitude, then confirm the number on your provider’s pricing page — the link next to every row goes there.
Why is output more expensive than input?
Because of how the two are processed. All input tokens are handled in one parallel pass, while output tokens are generated one at a time, and each one needs the model’s attention state read again. Providers therefore price output roughly three to five times higher than input. It is the main reason a feature that generates long text costs far more than one that classifies short text.
How do I know how many tokens my prompt is?
Use the token counter on the exact text you send, including system instructions and retrieved context. Guessing from word count is unreliable: the same English sentence is 10 tokens in English and up to 20 in Hindi with the current OpenAI vocabulary, and code is much denser than prose.
Does prompt caching always make things cheaper?
Only when the beginning of your prompt repeats and the provider keeps it in cache. Caches expire, some providers charge for the write, and short prompts may fall below the minimum cacheable size. When it applies, it is the single biggest saving available — moving a fixed system prompt to the front of the request often cuts the input bill by 40% or more.
What about open-weight models like Llama or Qwen?
They have no per-token price, because there is no API invoice: you pay for GPUs instead. That is why they are listed with a dash rather than a dollar figure. Costing them means estimating VRAM, quantization and hourly GPU rates — a different calculation from the one on this page, and one where long contexts become a memory constraint rather than a billing line.
Do you store or send my inputs anywhere?
No. Every calculation happens in your browser with plain arithmetic over a static price table. No number you type is transmitted, logged or shared, and the tool works with JavaScript offline once the page has loaded.

Aprende esto en el curso

Esta herramienta acompaña a estas etapas del recorrido gratuito de 11 etapas.

  • AI Token Counter →

    Paste any text to see exactly how a language model will split it into tokens — the units that decide what you pay and how much of the context window is left. The counter runs entirely in your browser.

Todas las herramientasSugerir una corrección