Free calculator · 13 models

What does an LLM API actually cost?

The LLM cost calculator is the model-by-model version of the AI cost calculator. Pick any hosted LLM, plug in your tokens, and see the real monthly bill — with every other model ranked next to it.

LLM cost calculator

Estimate your AI bill, model by model.

Pick an LLM, plug in your token mix and monthly calls, and see the real bill — ranked against every other model we track.

Current monthly cost$1,800
Cheapest alternative$108−94%
Model$ / M input$ / M outputMonthlyvs. current
Llama 3.1 8BMeta · Together$0.18$0.18$108−94%
GPT-4o miniOpenAI$0.15$0.60$135−93%
Qwen 2.5 72BAlibaba · OpenRouter$0.40$0.40$240−87%
DeepSeek V3DeepSeek$0.27$1.10$245−86%
Gemini 2.5 FlashGoogle$0.30$2.50$400−78%
Llama 3.1 70BMeta · Together$0.88$0.88$528−71%
Claude Haiku 4Anthropic$0.80$4.00$800−56%
Mistral Large 2Mistral$2.00$6.00$1,600−11%
Gemini 2.5 ProGoogle$1.25$10.00$1,625−10%
GPT-4.1OpenAI$2.00$8.00$1,800current
Claude Sonnet 4Anthropic$3.00$15.00$3,000+67%
GPT-5OpenAI$5.00$20.00$4,500+150%
Claude Opus 4Anthropic$15.00$75.00$15,000+733%

Prices reflect typical 2026 list pricing and may change. Verify with each provider before you commit to a budget.

Price alone doesn't tell you if a cheaper model can safely replace yours.

See safer LLM replacements →

LLM cost calculator, answered

What is the cheapest LLM API in 2026?
Hosted open-weight models (Llama 3.1 8B, Qwen 2.5 72B) on Together / OpenRouter / Fireworks are typically the cheapest. For proprietary models, GPT-4o mini and Gemini 2.5 Flash dominate the budget tier. The calculator ranks every model we track, cheapest first.
How is the LLM cost calculated?
Monthly cost = (calls × input tokens × $input per 1M) + (calls × output tokens × $output per 1M). No prompt caching, no batching, no enterprise discounts — just list price.
Does Claude cost more than GPT?
At list price, Claude Sonnet 4 ($3 / $15 per 1M) is roughly comparable to GPT-4.1 ($2 / $8). Claude Opus 4 ($15 / $75) is 3–4× GPT-4.1 on output tokens. The calculator shows the exact numbers for your workload.
Is DeepSeek really cheaper than Claude?
For raw token price, yes — DeepSeek V3 is around $0.27 / $1.10 per 1M, which is roughly 10× cheaper than Claude Sonnet on input. The catch is quality on hard tasks, which is what ModelSwitch measures for you.
What about Gemini pricing?
Gemini 2.5 Flash is around $0.30 / $2.50 per 1M, which makes it one of the cheapest proprietary models. Gemini 2.5 Pro is roughly comparable to Claude Sonnet on input, more expensive on output.
Can I get the pricing data?
The page renders the same data the calculator uses. The 13-model list is also exported as a typed constant in marketing/src/lib/llm-pricing.ts for any future benchmark page.