LLM API Cost Calculator

Paste your prompt, pick your knobs, see the exact cost across every major model. Accounts for cached-input pricing, batch-mode discounts, and context-window limits.

Your Prompt

auto from text above
expected response size
scale multiplier
for savings column
Input 1,200
Output 500
Total 1,700 tokens
× 1 call

Discounts & Mode

0%

Cache hit: OpenAI (50% off) & Anthropic (90% off) charge reduced rates for cached input tokens (prefix reuse on multi-turn or RAG). Batch: OpenAI & Anthropic both offer 50% off for non-realtime batch processing with 24h turnaround.

← Multi-model Token Counter
Model Context Input / Output per 1M Cost / Call Monthly vs Baseline

Pricing source: Official provider pages, verified April 2026. Rates are US dollars per 1,000,000 tokens. Cache hit % applies to input tokens only (OpenAI 50% off cached, Anthropic 90% off cache reads). Batch mode applies 50% off both input and output on OpenAI & Anthropic endpoints that support it. Self-hosted Llama rates are rough cloud-GPU inference estimates, not a direct API price. Rows highlighted in red exceed the model's context window and aren't usable for this prompt size. For production billing, always double-check with the provider's official calculator — volume discounts and enterprise rates are not modeled here.

About this tool

This calculator turns a prompt into a side-by-side cost comparison across every major LLM API — GPT-4o and friends, the Claude family, Gemini, DeepSeek, and hosted Llama. Paste text (or enter token counts directly), set an expected output size and monthly call volume, and see per-call and per-month cost for each model.

It also models the pricing details that dominate real bills: cached-input discounts (50% on OpenAI, 90% on Anthropic), the Batch API's 50% async discount, and each model's context-window ceiling.

When to use it

Worked example

Say each call sends 1,200 input tokens and generates 500 output tokens, at 100,000 calls per month. On a frontier model priced around $2.50/M input and $10/M output, that's roughly $0.008 per call — about $800/month. The same workload on a small model at $0.15/M input and $0.60/M output runs about $48/month. If 80% of your input is a reusable prefix, caching cuts the frontier-model bill by another chunk — the calculator applies each provider's specific discount so you can compare honestly.

Frequently asked questions

Why do input and output tokens have different prices?

Generating tokens costs providers much more compute than reading them, so output is typically priced 3–5× higher than input. Workloads that produce long responses (writing, code generation) are dominated by output cost; classification and extraction workloads are dominated by input.

What is cached-input pricing?

When consecutive calls share a long identical prefix — a system prompt, few-shot examples, or a document — providers can reuse the computation. OpenAI charges 50% and Anthropic 10% of the normal input rate for those cached tokens. The cache-hit slider models what fraction of your input qualifies.

When is the Batch API worth it?

Batch mode is 50% off in exchange for asynchronous delivery (results within 24 hours, usually much faster). It's ideal for backfills, evaluations, nightly summarization — anything without a user waiting on the response.

How current are the prices?

Prices are maintained against the providers' published pricing pages, but they change often. Treat the output as a planning estimate and confirm the current rate card before signing off on a budget.