StackQuoter
Audited December 2026. Independent math — partner links may earn a commission at no extra cost to you.
How we stay free

LLM API & Prompt Caching Cost Calculator

Model monthly token bills across OpenAI, Anthropic Claude, Google Gemini, and DeepSeek—including real prompt-caching discounts that naive token estimators ignore.

API workload & caching

5,000

Monthly volume: 150,000 calls/mo

2,500
600
50% cached
Model tier
Lowest cost model: Gemini 2.5 Flash

$89.16/mo

vs. $1,968.75/mo on Claude Sonnet 4. Caching saves $506.25/mo on the top model.

Compare RunPod GPUs

Monthly API bill across models (50% cached)

Gemini 2.5 FlashGoogle
$89.16/mo(-$21.09 cache)
In $0.15/1M (Cached $0.0375) · Out $0.6/1M$0.59 / 1K calls · 1M ctx
DeepSeek V3DeepSeek
$162.75/mo(-$37.50 cache)
In $0.27/1M (Cached $0.07) · Out $1.1/1M$1.09 / 1K calls · 128K ctx
GPT-4.1 miniOpenAI
$237.75/mo(-$56.25 cache)
In $0.4/1M (Cached $0.1) · Out $1.6/1M$1.59 / 1K calls · 1M ctx
DeepSeek R1DeepSeek
$326.48/mo(-$76.88 cache)
In $0.55/1M (Cached $0.14) · Out $2.19/1M$2.18 / 1K calls · 128K ctx
Claude 3.5 HaikuAnthropic
$525.00/mo(-$135.00 cache)
In $0.8/1M (Cached $0.08) · Out $4/1M$3.50 / 1K calls · 200K ctx
GPT-4.1OpenAI
$1,188.75/mo(-$281.25 cache)
In $2/1M (Cached $0.5) · Out $8/1M$7.93 / 1K calls · 1M ctx
Gemini 2.5 ProGoogle
$1,192.50/mo(-$176.25 cache)
In $1.25/1M (Cached $0.31) · Out $10/1M$7.95 / 1K calls · 1M+ ctx
Claude Sonnet 4Anthropic
$1,968.75/mo(-$506.25 cache)
In $3/1M (Cached $0.3) · Out $15/1M$13.13 / 1K calls · 200K ctx

Key takeaway (December 2026 benchmark)

At 5,000 API calls/day (2,500 input / 600 output tokens, 50% prompt cache hit rate), Gemini 2.5 Flash costs ~$89/month, DeepSeek V3 costs ~$162/month, GPT-4.1 mini costs ~$238/month, GPT-4.1 costs ~$1,188/month, and Claude Sonnet 4 costs ~$1,969/month. Enabling prompt caching cuts frontier model bills by 35%–65% on RAG and coding-agent workloads.

Audited LLM API rate card (USD per 1M tokens)

ModelProviderInput / 1MCached Input / 1MOutput / 1MContext
GPT-4.1OpenAI$2.00$0.50$8.001M
GPT-4.1 miniOpenAI$0.40$0.10$1.601M
Claude Sonnet 4Anthropic$3.00$0.30$15.00200K
Claude 3.5 HaikuAnthropic$0.80$0.0800$4.00200K
Gemini 2.5 ProGoogle$1.25$0.31$10.001M+
Gemini 2.5 FlashGoogle$0.15$0.0375$0.601M
DeepSeek V3DeepSeek$0.27$0.0700$1.10128K
DeepSeek R1DeepSeek$0.55$0.14$2.19128K

Token & prompt-caching formula

Every provider bills input and output tokens separately, with output tokens priced 4×–8× higher due to decoding bandwidth. When prompt caching hits, the cached input fraction is billed at the discounted cache-read rate (up to 90% off on Anthropic; ~75% off on OpenAI, Google, and DeepSeek):

Monthly Cost = InputM × [(1 − CacheRate) × InputRate + CacheRate × CachedRate] + OutputM × OutputRate

Frequently asked questions

How much does prompt caching save on real production apps?

Anthropic discounts cached input tokens by 90%, while OpenAI, Google Gemini, and DeepSeek discount cached inputs by ~75%. For RAG apps and multi-turn coding agents, caching typically saves 35%–65% of monthly token bills.

When is self-hosting GPUs cheaper than paying LLM APIs?

Only once steady monthly spend exceeds $1,500–$4,500/month on workloads solvable by open-weights models. Use our Self-Hosted LLM vs. API Break-Even Calculator to check your exact token threshold.

More pricing calculators

View all 12 tools