Skip to content
MyStackCost
Leer en español

LLM API Cost Calculator

Estimate what an AI feature will cost each month and compare models from OpenAI, Anthropic and Google side by side, based on your real usage.

Your numbers

Roughly 1,000 tokens ≈ 750 English words. Input includes the system prompt, history and any retrieved documents.

Models to compare

Anthropic

OpenAI

Google

Results

Queries per month

300,000

Tokens per month

600M

Monthly cost by model
  • Claude Haiku 5.5Anthropic$120.00
  • GPT-6 LunaOpenAI$120.00
  • Gemini 3.1 Flash-LiteGoogle$337.50
  • Gemini 3.8 FlashGoogle$900.00
  • Claude Sonnet 5.5Anthropic$2,400
  • GPT-6.1 SolOpenAI$2,400
  • Gemini 4 ArgonGoogle$2,400
  • Gemini 3.1 ProGoogle$2,700
  • Claude Opus 5.5Anthropic$4,800
  • Claude Fable 5.1Anthropic$12,000
  • GPT-6 AstraOpenAI$12,000
ModelInput / 1MOutput / 1MPer queryPer monthPer year
Claude Haiku 5.5AnthropicCheapest$0.10$0.50$0.0004$120.00$1,440
GPT-6 LunaOpenAI$0.10$0.50$0.0004$120.00$1,440
Gemini 3.1 Flash-LiteGoogle$0.25$1.50$0.00113$337.50$4,050
Gemini 3.8 FlashGoogle$0.75$3.75$0.003$900.00$10,800
Claude Sonnet 5.5Anthropic$2.00$10.00$0.008$2,400$28,800
GPT-6.1 SolOpenAI$2.00$10.00$0.008$2,400$28,800
Gemini 4 ArgonGoogle$2.00$10.00$0.008$2,400$28,800
Gemini 3.1 ProGoogle$2.00$12.00$0.009$2,700$32,400
Claude Opus 5.5Anthropic$4.00$20.00$0.02$4,800$57,600
Claude Fable 5.1Anthropic$10.00$50.00$0.04$12,000$144,000
GPT-6 AstraOpenAI$10.00$50.00$0.04$12,000$144,000

* Long-context pricing

  • Claude Haiku 5.5: queries with more than 100,000 input tokens are billed at $0.50 input / $2.50 output per 1M tokens.
  • GPT-6 Luna: queries with more than 272,000 input tokens are billed at $0.20 input / $0.75 output per 1M tokens.
  • GPT-6.1 Sol: queries with more than 272,000 input tokens are billed at $4.00 input / $15.00 output per 1M tokens.
  • Gemini 3.1 Pro: queries with more than 200,000 input tokens are billed at $4.00 input / $18.00 output per 1M tokens.
  • GPT-6 Astra: queries with more than 272,000 input tokens are billed at $20.00 input / $75.00 output per 1M tokens.

How the cost is calculated

Every LLM API bills separately for the tokens you send (input) and the tokens the model writes back (output), with prices quoted per million tokens. The calculator applies this formula to each model:

Cost per query = (input tokens ÷ 1,000,000 × input price)
               + (output tokens ÷ 1,000,000 × output price)

Queries per month = users × queries per user per day × days per month

Monthly cost = cost per query × queries per month

The yearly figure is simply the monthly cost × 12. Results are sorted from cheapest to most expensive, and the cheapest model is highlighted in green.

Long-context pricing

Some models charge a higher rate when a single query sends a very large input — for example, Claude Haiku 5.5 above 100K input tokens and Gemini 3.1 Pro above 200K. When that happens, the higher rate applies to the whole query, not just the tokens over the limit. The calculator applies it automatically when your input tokens exceed the threshold, and lists every model with this kind of pricing in a note under the results table.

Worked example

Imagine a customer-support assistant with 1,000 active users, each sending 10 questions a day, over 30 days:

  • Queries per month: 1,000 × 10 × 30 = 300,000
  • Each query sends 1,500 input tokens (system prompt + context + question) and gets 500 output tokens back.

For a model priced at $2.00 per million input tokens and $10.00 per million output tokens:

  • Input: 1,500 ÷ 1,000,000 × $2.00 = $0.003
  • Output: 500 ÷ 1,000,000 × $10.00 = $0.005
  • Cost per query: $0.008
  • Monthly cost: $0.008 × 300,000 = $2,400 (≈ $28,800 per year)

Notice that output is only a quarter of the tokens but more than half of the bill. Keeping answers concise is one of the easiest savings.

Typical token profiles

Token counts vary widely by use case. These ranges are a reasonable starting point before you measure your own traffic:

Use case Input tokens per query Output tokens per query Notes
Simple chatbot 300–800 150–400 Short system prompt, little history
Support assistant with RAG 1,500–4,000 300–600 Retrieved documents dominate input
Long-document summarization 10,000–50,000 500–1,500 Input-heavy; caching helps a lot
Code assistant 2,000–8,000 500–2,000 Files and history add up quickly
Classification / extraction 200–1,000 10–100 Ideal for small, cheap models

Tips to reduce your LLM API costs

  1. Route by difficulty. Send simple requests (classification, short answers) to small models and reserve frontier models for hard tasks. The gap between the cheapest and the most capable models can reach 100×.
  2. Use prompt caching. If many requests share a long system prompt or document, cached input tokens are billed at a fraction of the normal price.
  3. Batch what isn’t urgent. Most providers offer around 50% off for asynchronous batch jobs such as nightly reports or bulk tagging.
  4. Cap output length. Set a sensible maximum output and ask for concise answers or structured formats.
  5. Trim the context. Retrieve fewer, more relevant chunks and summarize long conversation histories instead of resending them in full.
  6. Measure real usage. Log token counts per request from day one; estimates made before launch are almost always off.

What this estimate does not include

Discounts (caching, batch, committed-use agreements), image or audio inputs, tool and search fees, fine-tuning, taxes and currency conversion are not included. Long-context rates are included only for the models whose providers publish them. Use the result as a planning estimate, not a quote.

Frequently asked questions

What is a token?

A token is the unit LLM providers bill by. It is a chunk of text, usually a word fragment. In English, 1,000 tokens are roughly 750 words; other languages such as Spanish typically need more tokens for the same text.

Why are output tokens more expensive than input tokens?

Generating text is more compute-intensive than reading it, because the model produces output one token at a time. Most providers charge 4 to 8 times more per output token than per input token, so long answers drive costs up quickly.

Does this calculator include prompt caching or batch discounts?

No. It uses standard on-demand prices. Prompt caching and batch processing can cut costs substantially, so treat the result as an upper bound if you plan to use them.

How do I estimate tokens per query for my app?

Add up everything you send on each call — system prompt, conversation history, retrieved documents and the user message — for input, and the typical answer length for output. Most provider dashboards and SDKs report exact token counts per request, which is the best source once you have a prototype.

How often are the prices updated?

Every day an automated check compares our prices with OpenRouter's public model list and cross-checks them against LiteLLM's open pricing file. Normal changes are published automatically; unusual ones (a change of more than 50%, a retired model or sources that disagree) are reviewed by a person first. The notice at the end of the page shows the date of the last update and links to each provider's official pricing page.

About the prices used

Prices updated automatically on October 15, 2026, source: OpenRouter and LiteLLM.

Official pricing pages:

Server Downtime Cost Calculator

Estimate the cost of an outage per hour and per incident from revenue, affected staff and recovery costs.

Meeting Cost Calculator

See the real cost of a meeting from attendees, salaries, length and frequency, with a live cost timer.