LLM API Monthly Cost, Prompt Caching & Batch Calculator
Project monthly LLM API bills factoring in prompt cache hit rates, 50% Batch API discounts, and output-to-input token price multipliers.
Input Parameters
Calculated Output
Primary Result
—
Adjust inputs to recalculate immediately.
2026 LLM API Rate Card Reference ($ per 1M Tokens)
Representative pricing tiers showing cached prefix discounts and 4x–6x output token cost multipliers.
| Model Tier | Input / 1M | Cached Input / 1M | Output / 1M | Ideal Workload |
|---|---|---|---|---|
| Budget Flash (DeepSeek V4 Flash / Flash-Lite) | $0.10 | $0.01 | $0.28–$0.40 | Extraction, routing, high-volume RAG |
| Near-Frontier Value (DeepSeek V4 Pro) | $0.55 | $0.02 | $1.40 | Coding & complex pipelines on budget |
| Workhorse (Claude Sonnet 5.5 / Sol / Gemini Pro) | $2.00 | $0.10–$0.20 | $10.00–$12.00 | Production agents, synthesis, SaaS UX |
| Frontier Reasoning (Astra / Opus) | $8.00–$10.00 | $0.80–$1.00 | $40.00–$50.00 | Hard architecture, math & deep audits |
Formula & Engineering Methodology
Monthly spend splits total input volume into uncached prefix tokens and prompt-cached tokens, then applies output rates and an optional 0.5x Batch API multiplier across 30 days.
monthly_reqs = requests_per_day * 30
total_in_m = (monthly_reqs * avg_input_tokens) / 1e6
cached_m = total_in_m * (cache_hit_pct / 100)
uncached_m = total_in_m - cached_m
total_out_m = (monthly_reqs * avg_output_tokens) / 1e6
monthly_cost = ((uncached_m * rate_in) + (cached_m * rate_cached) + (total_out_m * rate_out)) * (0.5 if batch_api else 1.0)
Variable Definitions
cache_hit_pct: Percentage of system prompt + shared context tokens served from KV prefix cache.rate_out: Output token price, typically 3x–6x higher than uncached input token rates.
Practical Note: Prompt caching typically requires minimum prefix lengths (e.g., 1,024 tokens) and consistent prefix ordering (put static system instructions and few-shot examples first).
Frequently Asked Questions
How does prompt caching cut RAG and agent bills by up to 90%?
Long system instructions, tool schemas, and shared knowledge bases stay warm in provider KV caches, dropping input token costs from $2.00/1M down to $0.10–$0.20/1M.
Why do output tokens cost 3x–6x more than input tokens?
Input prefill parallelizes across thousands of GPU cores in one pass, whereas autoregressive output generation executes serially token-by-token, tying up VRAM bandwidth.
When should I switch to Batch API?
Any offline evaluation, document enrichment, classification, or nightly summary job tolerant of 1–24 hour completion times saves a flat 50% with zero model change.