AI EngineerGuide

LLM API cost calculator

Compare the monthly API cost of every major model, then check token counts, context fit, prompt caching and what a model migration does to your bill.

Runs in your browser. Nothing you paste is uploaded.

Share of input served from cache
Discount
Monthly LLM API cost by model
Pin📌
GPT-5 Nano OpenAI
gpt-5-nano retires Dec 11, 2026
$0.05$0.40$0.005——
GPT-6 Luna OpenAI
gpt-6-luna
$0.10$0.50$0.010——
Claude Haiku 5.5 Anthropic
claude-haiku-5-5
$0.10$0.50$0.010——
Gemini 2.5 Flash-Lite Google
gemini-2.5-flash-lite
$0.10$0.40$0.010——
Ministral 3 3B Mistral
ministral-3b-2512
$0.10$0.10$0.010——
Ministral 3B Mistral
ministral-3b-latest
$0.10$0.10$0.010——
Voxtral Small Mistral
voxtral-small-2507
$0.10$0.40———
Voxtral Small Mistral
voxtral-small-latest
$0.10$0.40———
GPT-4o mini OpenAI
gpt-4o-mini retires Jan 14, 2027
$0.15$0.60$0.075——
DeepSeek V4.1 Flash 1017 DeepSeek
deepseek-flash
$0.15$0.60$0.003——
Ministral 3 8B Mistral
ministral-8b-2512
$0.15$0.15$0.015——
Ministral 8B Mistral
ministral-8b-latest
$0.15$0.15$0.015——
Mistral Small 4 Mistral
mistral-small-2603
$0.15$0.60$0.015——
Mistral Small Mistral
mistral-small-latest
$0.15$0.60$0.015——
GLM-5.3-Flash Mistral
zai-glm-5-3-flash
$0.15$0.50$0.030——
GPT-5.4 nano OpenAI
gpt-5.4-nano retires Apr 1, 2027
$0.20$1.25$0.020——
GPT-5.6 Luna OpenAI
gpt-5.6-luna
$0.20$1.20$0.020——
Ministral 3 14B Mistral
ministral-14b-2512
$0.20$0.20$0.020——
GPT-5 Mini OpenAI
gpt-5-mini retires Dec 11, 2026
$0.25$2.00$0.025——
Gemini 3.1 Flash Lite Google
gemini-3.1-flash-lite retires May 7, 2027
$0.25$1.50$0.025——
Gemini 2.5 Flash Google
gemini-2.5-flash
$0.30$2.50$0.030——
Gemini 3.5 Flash Lite Google
gemini-3.5-flash-lite
$0.30$2.50$0.030——
Gemini Flash-Lite Latest Google
gemini-flash-lite-latest
$0.30$2.50$0.030——
Codestral 25.08 Mistral
codestral-2508
$0.30$0.90$0.030——
Codestral Mistral
codestral-latest
$0.30$0.90$0.030——
DeepSeek V4.1 Flash 1017 Mistral
deepseek-v4-1-flash-1017
$0.30$1.20$0.007——
GPT-4.1 mini OpenAI
gpt-4.1-mini retires Jan 14, 2027
$0.40$1.60$0.100——
Gemini 3 Flash Preview Google
gemini-3-flash-preview
$0.50$3.00$0.050——
Mistral Large 3 Mistral
mistral-large-2512
$0.50$1.50$0.050——
Mistral Large Mistral
mistral-large-latest
$0.50$1.50$0.050——
DeepSeek V4 Pro DeepSeek
deepseek-v4-pro
$0.66$1.98$0.022——
Mistral Large 4 Mistral
mistral-large-4
$0.70$2.10$0.070——
Mistral Large 4.0.8 Mistral
mistral-large-4-0-8
$0.70$2.10$0.070——
GPT-5.4 mini OpenAI
gpt-5.4-mini
$0.75$4.50$0.075——
Gemini 3.6 Flash Google
gemini-3.6-flash
$0.75$3.75$0.075——
Gemini 3.7 Flash Google
gemini-3.7-flash
$0.75$3.75$0.075——
Gemini 3.8 Flash Google
gemini-3.8-flash
$0.75$3.75$0.075——
Gemini Flash Latest Google
gemini-flash-latest
$0.75$3.75$0.075——
GPT-6.1 Terra OpenAI
gpt-6.1-terra
$1.00$5.00$0.050——
Claude Haiku 4.5 Anthropic
claude-haiku-4-5
$1.00$5.00$0.100——
Grok Build 0.1 xAI
grok-build-0.1
$1.00$2.00$0.200——
GPT-5 OpenAI
gpt-5 retires Dec 11, 2026
$1.25$10.00$0.125——
GPT-5.1 OpenAI
gpt-5.1 retires Apr 1, 2027
$1.25$10.00$0.125——
Gemini 2.5 Computer Use Preview 10-2025 Google
gemini-2.5-computer-use-preview-10-2025
$1.25$10.00———
Gemini 2.5 Pro Google
gemini-2.5-pro
$1.25$10.00$0.125——
Grok 4.20 (Non-Reasoning) xAI
grok-4.20-0309-non-reasoning
$1.25$2.50$0.200——
Grok 4.20 (Reasoning) xAI
grok-4.20-0309-reasoning
$1.25$2.50$0.200——
Grok 4.20 Multi-Agent xAI
grok-4.20-multi-agent-0309
$1.25$2.50$0.200——
Grok 4.3 xAI
grok-4.3
$1.25$2.50$0.200——
GLM-5.3 Mistral
zai-glm-5-3
$1.40$4.40$0.140——
Gemini 3.5 Flash Google
gemini-3.5-flash
$1.50$9.00$0.150——
Mistral Medium 3.5 Mistral
mistral-medium-2604
$1.50$7.50$0.150——
Mistral Medium Mistral
mistral-medium-latest
$1.50$7.50$0.150——
GPT-5.2 OpenAI
gpt-5.2
$1.75$14.00$0.175——
GPT-5.3 Codex OpenAI
gpt-5.3-codex retires Apr 1, 2027
$1.75$14.00$0.175——
GPT-5.3 Codex Spark OpenAI
gpt-5.3-codex-spark
$1.75$14.00$0.175——
GPT-4.1 OpenAI
gpt-4.1 retires Jan 14, 2027
$2.00$8.00$0.500——
GPT-5.6 Terra OpenAI
gpt-5.6-terra
$2.00$12.00$0.200——
GPT-6 Sol OpenAI
gpt-6-sol
$2.00$10.00$0.200——
GPT-6.1 Sol OpenAI
gpt-6.1-sol
$2.00$10.00$0.100——
o3 OpenAI
o3 retires Dec 11, 2026
$2.00$8.00$0.500——
Claude Sonnet 5 Anthropic
claude-sonnet-5
$2.00$10.00$0.200——
Claude Sonnet 5.5 Anthropic
claude-sonnet-5-5
$2.00$10.00$0.100——
Gemini 3.1 Pro Preview Google
gemini-3.1-pro-preview
$2.00$12.00$0.200——
Gemini 3.1 Pro Preview Custom Tools Google
gemini-3.1-pro-preview-customtools
$2.00$12.00$0.200——
Gemini 4 Argon Google
gemini-4-argon
$2.00$10.00$0.100——
Gemini Pro Latest Google
gemini-pro-latest
$2.00$12.00$0.200——
Grok 4.5 xAI
grok-4.5
$2.00$6.00$0.300——
Grok 4.6 xAI
grok-4.6
$2.00$6.00$0.500——
Grok 4.7 xAI
grok-4.7
$2.00$6.00$0.500——
GPT-4o OpenAI
gpt-4o retires Jan 14, 2027
$2.50$10.00$1.250——
GPT-4o (2024-08-06) OpenAI
gpt-4o-2024-08-06 retires Jan 14, 2027
$2.50$10.00$1.250——
GPT-4o (2024-11-20) OpenAI
gpt-4o-2024-11-20 retires Jan 14, 2027
$2.50$10.00$1.250——
GPT-5.4 OpenAI
gpt-5.4
$2.50$15.00$0.250——
Claude Sonnet 4.5 Anthropic
claude-sonnet-4-5 retires Nov 30, 2026
$3.00$15.00$0.300——
Claude Sonnet 4.6 Anthropic
claude-sonnet-4-6
$3.00$15.00$0.300——
GPT-5.6 OpenAI
gpt-5.6
$4.00$20.00$0.400——
GPT-5.6 Sol OpenAI
gpt-5.6-sol
$4.00$20.00$0.400——
Daybreak Blue OpenAI
gpt-daybreak-blue-latest
$4.00$20.00$0.400——
Claude Opus 5.5 Anthropic
claude-opus-5-5
$4.00$20.00$0.200——
GPT-5.5 OpenAI
gpt-5.5
$5.00$30.00$0.500——
Claude Opus 4.5 Anthropic
claude-opus-4-5
$5.00$25.00$0.500——
Claude Opus 4.6 Anthropic
claude-opus-4-6
$5.00$25.00$0.500——
Claude Opus 4.7 Anthropic
claude-opus-4-7
$5.00$25.00$0.500——
Claude Opus 4.8 Anthropic
claude-opus-4-8
$5.00$25.00$0.500——
Claude Opus 5 Anthropic
claude-opus-5
$5.00$25.00$0.500——
GPT-6 Astra OpenAI
gpt-6-astra
$10.00$50.00$1.000——
Claude Fable 5 Anthropic
claude-fable-5
$10.00$50.00$1.000——
Claude Fable 5.1 Anthropic
claude-fable-5-1
$10.00$50.00$0.250——
Daybreak Red OpenAI
gpt-daybreak-red-latest
$12.50$75.00$1.250——
GPT-5 Pro OpenAI
gpt-5-pro retires Dec 11, 2026
$15.00$120.00———
o3-pro OpenAI
o3-pro retires Dec 11, 2026
$20.00$80.00———
GPT-5.2 Pro OpenAI
gpt-5.2-pro
$21.00$168.00———
GPT-5.4 Pro OpenAI
gpt-5.4-pro
$30.00$180.00———
GPT-5.5 Pro OpenAI
gpt-5.5-pro
$30.00$180.00———

Pin up to 4 models to keep them on top. Months are 30 days. Prices from models.dev, last data update 2026-11-02; see the official pricing pages below.

How to use it

  1. Enter your average input and output tokens per request and your requests per day. If you don’t know your token counts, paste a real prompt into the Token count tab.
  2. Set the share of input served from the prompt cache, tick Batch API if the work can wait, and pin up to 4 models to compare.
  3. If you’re replacing a retiring model, open Old vs new model to see how price, limits and token counts change, then copy the share link for your team.

How we calculate this

Cost per request = (uncached input × input price + cached input × cache read price + output × output price) ÷ 1,000,000, with prices in USD per million tokens. Monthly cost = cost per request × requests per day × 30. The Batch API option halves the result for providers that list a 50% batch discount. The Prompt caching tab compares writing a prefix once and reading it n times against sending it uncached n + 1 times; break-even is the smallest n where caching is cheaper.

Prices come from models.dev (MIT), last data update 2026-11-02. On 2026-11-02 we checked 29 models against the official pages: all 17 Anthropic models matched exactly, as did gpt-5.6-sol/terra/luna, gpt-6-luna, gpt-4o, gpt-4.1, gemini-3.8-flash, gemini-3.5-flash-lite, gemini-3.1-pro-preview, grok-4.7 and deepseek-v4-pro.

Token count and context fit

OpenAI counts are exact, computed in your browser with gpt-tokenizer 4.1.0 (MIT). Claude and Gemini counts are estimates: characters ÷ 3.5 for Claude before 4.7 (Anthropic glossary), × 1.3 for Claude 4.7 and later (Anthropic token counting), and characters ÷ 4 for Gemini (Google), all checked 2026-11-02. The provider-specific token counter pages explain each method.

A prompt fits when its input is within the model’s max input (or the context window when there’s no separate cap), and input plus reserved output stays within the window, with the reserved output no larger than the model’s max output.

Old vs new model

This tab compares list prices, limits and the cost of the same traffic on two models. When you move from a Claude model before 4.7 to Claude 4.7 or later, it scales token counts by 1.3x, per Anthropic’s token counting docs. Providers don’t publish how their tokenizers compare with each other’s, so for a switch between providers, recount a real prompt in the Token count tab.

Things this calculator doesn’t model

  • Long-context prices. OpenAI says “Prompts with >272K input tokens are priced at 2x input and 1.5x output for the full request.” Gemini 3.1 Pro charges more above 200K-token prompts and Claude Haiku 5.5 above 100K. The table uses the standard tier.
  • Promotional prices. OpenAI lists gpt-5.6-sol’s current price “at least through November 21, 2026”. Google lists gemini-3.8-flash at this price “through December 31, 2026”, rising to $1.50 / $7.50 per million input/output tokens on January 1, 2027.
  • DeepSeek peak hours. The DeepSeek prices shown are off-peak rates. From 01:00 to 04:00 and 06:00 to 10:00 UTC on weekdays, DeepSeek charges double.
  • Surcharges for priority or fast modes, regional or data-residency endpoints (for example a 1.1x multiplier for Anthropic US-only inference), and Gemini’s hourly cache storage.
  • mistral-large-latest points to Mistral Large 3, which Mistral deprecated on October 31, 2026 in favor of Mistral Large 4.

Official pricing pages

FAQ

How is the monthly cost calculated?

Per request: uncached input × input price + cached input × cache read price + output × output price, all per million tokens. The monthly cost is that × requests per day × 30. With Batch API ticked, we halve it for providers whose pricing pages list a 50% batch discount (OpenAI, Anthropic, Google and Mistral).

How many tokens is my prompt?

Paste it into the Token count tab. OpenAI counts are exact (o200k_base and cl100k_base); Claude and Gemini counts are estimates using the providers’ published characters-per-token guidance.

Which LLM has the largest context window?

Open the Context fit tab and sort by context window. Several OpenAI, Anthropic, Google, xAI, DeepSeek and Mistral models accept around 1 million tokens; check max input and max output too, since some providers cap input below the full window.

Is prompt caching worth it?

Usually, if the same prefix is reused within the cache lifetime. On Anthropic’s 5-minute cache a write costs 1.25x input and a hit 0.1x, so it pays off after one hit. The Prompt caching tab shows the break-even for any model.

Will moving to Claude Sonnet 5.5 cost more than Sonnet 4.5?

Per token it’s cheaper ($2/$10 vs $3/$15 per million input/output tokens), but Anthropic says the newer tokenizer produces about 30% more tokens for the same text. The Old vs new model tab applies that adjustment.

Why is my real bill different?

Common reasons: long-context pricing tiers (for example OpenAI prices prompts over 272K tokens at 2x input), reasoning tokens billed as output, tool definitions and images adding input tokens, regional or priority surcharges, and promotional prices that end.