LLM API Cost Calculator
Runs locallyCompare monthly LLM API costs with prompt caching, batch discounts and editable model prices.
What is LLM API Cost Calculator?
Estimate per-request, daily, and monthly API spend across OpenAI, Anthropic, Google, Meta, and Mistral models. Factor in prompt cache hit rates and batch API discounts, compare up to 6 models side by side, and override any price locally with full source links and last-updated dates.
How to use LLM API Cost Calculator
- Step 1
Enter average input tokens, output tokens, daily requests, and optional cache hit rate or batch discount.
- Step 2
Select up to 6 models to compare side by side.
- Step 3
Inspect per-request, daily, and monthly costs plus break-even insights.
- Step 4
Click Edit Prices to customize any model’s rates locally (saved in your browser).
Features
- Driven by versioned `src/data/llm-models.json` with lastUpdated date and official pricing links
- Editable pricing table with local overrides and one-click reset to reference prices
- Supports cached input pricing, cache hit rate %, and 50% batch API discount toggle
- Side-by-side comparison of up to 6 models with cost breakdown bars
- Runs completely locally in your browser
Example
Input
2,000 input tokens, 500 output tokens, 10,000 req/day, 50% cache hit
Output
Compare GPT-4o vs GPT-4o mini vs Claude Sonnet 4 vs Gemini 2.5 Flash monthly spend
Reveals how caching and model tiering affect monthly run rate.
Frequently asked questions
Are the listed LLM prices guaranteed current?
No — pricing changes frequently. Every row links to the provider’s official pricing page and lets you override rates locally.
How does prompt caching affect cost?
Cached input tokens are billed at the model’s reduced cached rate for the specified cache hit percentage.
Are my custom price overrides saved?
Yes, overrides are persisted locally in your browser storage.
Does this make any API calls?
No, calculations happen locally.
Related tools
LLM Token Counter
Exact OpenAI o200k/cl100k token counts plus labelled estimates for Claude, Gemini and Llama.
JSON Formatter & Validator
Format, validate, minify, repair, sort keys and query JSON with Tree and Table views.
Markdown Editor
Split live GFM Markdown editor with DOMPurify sanitization, TOC, word stats and HTML/PDF export.