Token Cost Calculator

One number in → full cost breakdown across every major frontier API, priced against your local server. Includes input, cached-read, cache-write, and output tiers.

Total tokens

Monthly volume — figures below are per month and per day (÷30), plus yearly (×12).

Average in / out / cache split

Output share of all tokens %
Cache hits share of input %
Fresh writes share of cache %
Input Cache write Cache read Output

Local server

≈ amortized GPU + electricity. Reference points: idle power-only ≈ $0.02 · 8×4090 running 70B ≈ $0.10–0.30 · datacenter API-style ≈ $0.50+. Output-heavy workloads cost more per token — model it by splitting the number if needed.

How costs are computed

For each model:
cost = (in×pricein + read×pricecache + write×pricewrite + out×priceout) ÷ 1M

Cache reads are billed at the discounted cache-read rate (typically 10–20% of input). Fresh cache writes are billed at the write rate where a provider charges a premium (e.g. Anthropic 1.25× input); providers without a write premium bill those tokens at the plain input rate. Models with no cache support price cache tokens at the input rate. If the typical context exceeds a model's long-tier threshold (OpenAI ≥272K, Gemini Pro ≥200K est.), the row is badged long tier and bills all four rates at the long prices.

Frontier API comparison

Model In $/M Cache $/M Out $/M Your bill /mo · /day ⇅ Eff. $/M Saved vs local
Prices per 1M tokens, standard tier, US regions, as of Sep 2026 — pulled from OpenAI & Anthropic official pricing pages and the OpenRouter model catalog (Google, xAI, DeepSeek, Mistral). Prices change constantly; edit the MODELS array at the bottom of this file to update. Long-context surcharges modeled where published: OpenAI ≥272K context ⇒ input & cache rates ×2, output ×1.5 (official long-context columns). Gemini Pro ≥200K estimated at the same pattern — only one tier is published there, verify if it matters to you. All other providers price flat across context size.