Skip to content

LLM API cost calculator

Your tokens per month, then a model, then every way to buy it.

Step 1: Your usage

Step 2: Model

10 popular models, cheapest first at your usage

ModelPer month
$25.94
$78.55
$109.00
$151.35
$151.35
$162.10
$203.45
$203.45
$203.45
$254.40

Step 3: Result

CompareModel page

Grok 4.20 at 120M input and 25M output tokens a month, 40% of input cached: from $162.10 a month.

Way to buyPer month
xAI API
The lab's own list price · $1.25 / $2.5
$162.10Cheapest
Helicone
Gateway, no token markup, plan from $79/mo · $1.25 / $2.5
$162.10BYOK at costSame
Kong AI Gateway
Gateway, no token markup, plan from $100/mo · $1.25 / $2.5
$162.10Same
LiteLLM
Gateway, no token markup, self-hosted · $1.25 / $2.5
$162.10BYOK at costSame
Vercel AI Gateway
Gateway, no token markup · $1.25 / $2.5
$162.10BYOK at costSame
Cloudflare AI Gateway
Gateway, 5% on credits · $1.31 / $2.63
$170.20+$8.10 (+5.0%)
Requesty
Gateway, 5% on credits · $1.31 / $2.63
$170.20+$8.10 (+5.0%)
Eden AI
Gateway, 5.5% on credits · $1.32 / $2.64
$171.02+$8.92 (+5.5%)
OpenRouter
Gateway, 5.5% on credits · $1.32 / $2.64
$171.02BYOK at cost+$8.92 (+5.5%)

Cached input is billed at the cache-read price where one is published; batch applies only where the lab sells a batch tier. Platform rows are list prices without caching or batch. Gateway rows add the gateway's fee on credits; BYOK is the cost with your own provider key. Not priced here (no published token fee): Martian Gateway, Portkey, TrueFoundry AI Gateway.

Questions

How do I estimate my monthly LLM API cost?

Multiply the millions of input tokens you send by the input price, add the millions of output tokens times the output price, and subtract the discount on any input served from cache. The calculator does this for every model at once.

How many tokens is a word?

For English text, about 1.3 tokens per word, or roughly 750 words per 1,000 tokens. Code and other languages use more tokens per word.

How much does prompt caching save?

Cached input is typically billed at 10% to 50% of the normal input price, depending on the provider. Long, repeated system prompts and documents benefit most.

What is the Batch API discount?

OpenAI, Anthropic, Google, Mistral and AWS Bedrock sell asynchronous batch processing at about half price, with results returned within 24 hours.

List prices from providers' pages on the date shown; your contract may differ. Logos via logo.dev; trademarks belong to their owners.

Weekly: LLM API list prices that changed, Thursday mornings.