Skip to main content
Field Guide

LLM API Cost Calculator (2026): Compare Claude, GPT, Gemini & More

A free LLM API cost calculator: pick a model, enter your token usage, and see exactly what it costs per request and per month — then compare every major model for the same workload side by side. Prompt caching and Batch API discounts included. Pricing is per 1M tokens, current as of June 2026 (verify with each provider before relying on it).







Cost per request
Cost per month
Cost per year

Caching bills cached input at ~10% of the normal input rate; Batch API applies a 50% discount to both input and output. Estimates only.

Every model, your workload

The same usage (set above) priced across all models, cheapest first:

Model Input $/1M Output $/1M Cost / month

Prices per 1M tokens, July 2026. Claude Sonnet 5 has introductory pricing ($2 in / $10 out) through Aug 31, 2026; the calculator uses its standard rate. Always confirm current rates with the provider — see our LLM API pricing reference.

How LLM API pricing works

Every API charges separately for input tokens (your prompt, system instructions, and any context or documents you send) and output tokens (the model’s response). Prices are quoted per million tokens (1M). A token is roughly ¾ of a word in English, so 1,000 tokens is about 750 words. Output is almost always more expensive than input — often 3–5x — so response length drives cost more than prompt length for many workloads.

Two discounts that cut the bill

  • Prompt caching: if you reuse a large, stable prefix (a system prompt, a document, a tool schema) across many requests, the cached portion is billed at roughly 10% of the normal input rate. Set the cache slider above to model it. Highest leverage when you have a big fixed context and many calls.
  • Batch API: submit requests asynchronously (results within ~24 hours) for a 50% discount on both input and output. Ideal for offline analysis, enrichment, and bulk processing that doesn’t need a real-time answer.

Cut costs without losing quality

  • Right-size the model. Route simple tasks to a cheap model (Haiku 4.5, Gemini Flash) and reserve a flagship (Opus 4.8, Fable 5) for work that genuinely needs it. The comparison table above shows the gap for your exact workload.
  • Cache stable context instead of re-sending it every call.
  • Batch anything offline.
  • Trim output. Set tight max_tokens and ask for concise responses where you don’t need length — output is the expensive side.

FAQ

How accurate is this calculator?

It uses published per-token list prices as of June 2026 and standard discount rates (caching ~90% off cached input, Batch 50% off). Your real bill can vary with negotiated/enterprise rates, long-context surcharges, and exact token counts. Always confirm current pricing with the provider.

How many tokens will my prompt use?

Roughly: tokens ≈ words ÷ 0.75 for English. For exact counts, use the provider’s token-counting endpoint rather than an estimate.

Which model is cheapest?

It depends on your input/output ratio — that’s why the table recalculates for your numbers. Output-heavy workloads favor models with low output rates; input-heavy (long-context) workloads favor low input rates and prompt caching.

Last updated: June 2026. Prices change frequently — verify with each provider.