AiCost

AI API Cost Calculator — Every Provider, Token to USD

Who this is for: For developers comparing providers per token — and for anyone with a usage JSON in hand who wants the dollar answer in one click.

All providers, one calculator — plus paste any usage JSON and get the dollar figure.

Quick answer: Flagship spread (per 1M tokens, Oct 2026): DeepSeek V3 $0.28 in → Claude Opus 4.1 $15 in; outputs $0.42 → $75. The same 10M-in/2M-out month: $32.50 on GPT-5 vs $3.64 on DeepSeek V3 — 9× cheaper; flagship Claude Opus 4.1 lands $300. Paste any usage JSON below for an instant dollar figure.

tok
tok
tok

cached rate $0.125/M

Total cost
$32.50
GPT-5 · list price
Input side
$12.50
10,000,000 tok
Output side
$20.00
2,000,000 tok
OpenAI / Anthropic / DeepSeek / Grok formats · 100% client-side
Input (10,000,000 tok)$12.50
Output (2,000,000 tok)$20.00
Total$32.50
Price-check habit: the same 10M-in / 2M-out workload runs $32.50 on GPT-5, $60.00 on Claude Sonnet 4.5 and $3.64 on DeepSeek V3 — benchmark your own tasks before paying flagship prices.
All list prices per 1M tokens, verified Oct 2026 from each provider's pricing page. Tiered context pricing (Gemini >200k), batch discounts and taxes not reflected. Parsing runs client-side — nothing you paste leaves this page.
Core facts
CheapestDeepSeek V3 $0.28/$0.42 /M
OpenAI floorGPT-5 nano $0.05/$0.40
Flagship band$1.25–15 in / $8–75 out
Example month10M in + 2M out: $3.64–300
Cache readClaude 10% · OpenAI 10–50%
StatusList prices collected Oct 2026 from each provider's public pricing page. Providers change tiers often — always confirm on the official page before billing decisions.

What does AI API usage cost across providers?

List prices per 1M tokens (Oct 2026): the flagship tier spans $0.28 (DeepSeek V3) to $15 (Claude Opus 4.1) input; the budget tier spans $0.05 (GPT-5 nano) to $0.30 (Gemini 2.5 Flash). The same 10M-in/2M-out monthly workload costs $32.50 on GPT-5, $60.00 on Claude Sonnet 4.5, $6.50 on GPT-5 mini, and $3.64 on DeepSeek V3 — an order-of-magnitude spread for comparable output quality on many tasks. Paste a raw API response into the calculator and it extracts usage automatically (prompt_tokens / completion_tokens / cached), prices it, and shows the cached-input savings. All extraction runs in your browser; nothing is uploaded.

Common uses

  • Pricing a workload across providers before committing
  • Paste an API response JSON → instant dollar cost
  • Comparing cached-input savings between providers
  • Checking a provider invoice against list prices

How the JSON paste works

Paste any chat-completion API response (OpenAI, Anthropic, DeepSeek, Grok formats all work — including nested usage objects). The extractor looks for prompt_tokens / input_tokens, completion_tokens / output_tokens and cached_tokens keys, fills the token fields, and prices them at the selected model's list rates. Nothing is sent anywhere: the parsing is a regex over text inside your browser tab.

Frequently Asked Questions

Which AI API is cheapest?
DeepSeek V3 at $0.28/$0.42 per 1M is the price floor among major providers; GPT-5 nano ($0.05/$0.40) is OpenAI's floor and Gemini 2.5 Flash-Lite ($0.10/$0.40) Google's. Flagship quality at budget prices is real for many workloads — benchmark on your own tasks.
How do I calculate API cost from tokens?
Cost = tokens ÷ 1,000,000 × price-per-1M, separately for input and output. Example: 50k input + 10k output on Claude Sonnet 4.5 ($3/$15) = $0.15 + $0.15 = $0.30.
What are cached tokens on Claude?
Anthropic's prompt caching bills cache *reads* at 10% of base input price (e.g. Sonnet 4.5: $0.30/M vs $3/M) and cache writes at 125%. For agent workloads with long stable prompts, caching routinely halves the bill.
How accurate is this calculator?
It uses each provider's published list prices (verified Oct 2026). Your invoice can differ via discounts, batch pricing (often −50%), tiered context pricing (Gemini), or taxes — it's an estimator, not a billing system.
Is my pasted data stored?
No. Parsing and pricing happen entirely in your browser (client-side JavaScript) — the JSON you paste never leaves the page. No account, no upload, no logging.

More API cost

Related guides