Token Cost Calculator

Token Cost Calculator

Compare prices across OpenAI, Claude, Gemini, DeepSeek, MiniMax, and Grok. Real tokenizer for OpenAI, accurate estimates for the rest.

Last updated: 2026-10-27

1,000
2,000
400
1,000 × 2,000in + 400out = 2,000,000 input,400,000 output tokens

Estimated cost across 1 models

StepFun Cheapest

Step 5 Preview

$3.08/ month
$36.96 / year

Preview release (2026-09-20); open weights followed on 2026-10-15. Cache-miss input includes writing to the cache; output tokens include the reasoning trace.

Input
$2.00
Output
$1.08400,000 tokens
Input
$1.00 / 1M2,000,000 tokens
Output
$2.70 / 1M
Context window
1,000,000Last updated: 2026-10-23

Prices verified 2026-10-27. Source: official provider pricing pages. · Machine-readable: /api/prices.json

Quick takeaways
  • 1Output tokens usually cost 2.7× to 8.3× more than input — keeping replies short is the highest-leverage cost saver.
  • 2Prompt caching drops repeat-input cost by 75–98% depending on provider and model — Anthropic 90–98% off, OpenAI 90–95% off, Google 90–95% off, DeepSeek 97–98% off the standard input rate.
  • 3DeepSeek off-peak hours bill at 50% less than peak — schedule batch jobs accordingly.
  • 4Long-context surcharges are real: a model with a long-context band bills 2× input above the band threshold (from 200K tokens) — check the model card before sending a huge context.
Token Cost Calculator

How to bring the bill down

  1. 1Use a smaller model for routing / classification — Claude Haiku 4.5 costs 10× less than Claude Fable 5.1, and GPT-6 luna 100× less than GPT-6 astra on output.
  2. 2Cache repeat prefixes (system prompts, tool schemas) — Anthropic cached reads run 90–98% below the standard input rate, depending on the model.
  3. 3Set max_tokens explicitly — output is the expensive side; capping it prevents runaway replies.
  4. 4Batch non-urgent jobs into DeepSeek off-peak hours, which bill at 50% less than peak for both input and output.
  5. 5Trim long context — a long-context band bills 2× input rate above its threshold (from 200K tokens); chunk documents that don’t need the rest.
Token Cost Calculator

Frequently asked questions

How much does 1 million tokens cost?
It depends entirely on the model. As of 2026-10-27, 1M tokens costs $0.10 / $0.50 on GPT-6 luna, $1 / $5 on Claude Haiku 4.5, $4 / $20 on Claude Opus 5.5, and $0.30 / $1.20 on DeepSeek V4.1-Flash 1017 (input / output, per 1M tokens). For comparison, GPT-5 nano is retired: it was delisted in 2026-09, and the registry keeps its last verified rates at $0.05 / $0.40. Use the calculator above to compare every model in the registry at your exact usage.
Why is output more expensive than input?
Output costs more than input on every model in our registry. Across the 26 active models we price the multiple spans 2.7× to 8.3×, and most of them sit near 5× — the multiple is a property of the model, not of the vendor. Output tokens are billed higher because generation is the compute-heavy step (autoregressive decoding), while input is a single forward pass.
How do I count tokens?
For OpenAI models, the calculator uses the real tokenizer (o200k_base for the GPT-5 and GPT-6 families, cl100k_base for older families). For Anthropic, Google, DeepSeek, MiniMax, Grok and Kimi, it uses a CJK-aware character approximation — accurate to within ~10% for English, ~5% for Chinese.
How accurate is this calculator?
Token counts are exact for OpenAI-family models and approximate for everyone else. Prices are sourced from each provider’s official pricing page and re-verified regularly, but providers change prices without notice — always check the source link on each model card before relying on a number for billing.
What is prompt caching?
Prompt caching lets you reuse a previously-seen prefix (system prompt, tool definitions, large document) across requests at a fraction of the normal input cost. The discount is per model, not per vendor: across the active models we price, Anthropic cached reads run 90–98% off the standard input rate, OpenAI 90–95%, Google 90–95%, DeepSeek 97–98%. The biggest single cost saver for repeat-prompt workloads.
Does OpenRouter add a markup?
Not on the tokens. OpenRouter bills inference at the provider’s list price on every plan and charges its platform fee when you buy credits — 5.5% on Standard, 8% on Business — never per request. The OpenRouter figures here are this site’s own estimate: a 1.05× (5%) multiplier that spreads that credit fee over token price. It is an approximation of the total, not an OpenRouter quote; check openrouter.ai for the live rate before relying on a number for billing.
Is the Claude subscription cheaper than the API?
Up to a point, yes. Claude Pro ($20/mo) and Max ($200/mo) include generous usage caps. Beyond roughly 2.86M input + 1.43M output tokens per month (Pro) or roughly 28.6M input + 14.3M output tokens per month (Max), the API starts winning on pure cost. Those figures assume a 1:2 input:output mix at current Claude Sonnet 5 rates and ignore prompt-cache savings, which would push the break-even higher. Use the calculator above to find your own.
How often are prices updated?
Prices are re-verified against each provider’s official pricing page regularly. The "Updated 2026-10-27" stamp at the top of the page reflects the last verification, and the examples in this FAQ were read from that same registry snapshot. A machine-readable version is available at /api/prices.json — same data, designed for AI agents and programmatic access.
More calculators

Pick the right page for your use case

OpenRouter Pricing Calculator

See what your tokens actually cost after the OpenRouter markup — and when going direct to the provider is cheaper.

Calculate OpenRouter markup →

Claude Token Cost Calculator

Cost per token and monthly estimates for Claude Opus, Sonnet, and Haiku — with the Anthropic API.

Calculate Claude API cost →

DeepSeek API Pricing

V4-Pro and V4.1-Flash per-token rates, off-peak hours, and prompt-cache savings — compared to Claude, GPT, and Gemini.

View DeepSeek API pricing →

ChatGPT API Pricing

GPT-6 and GPT-5 per-token rates, Batch API 50% off, and prompt-cache savings — compared to Claude, Gemini, and DeepSeek.

View ChatGPT API pricing →

Gemini API Pricing

Google Gemini rates per 1M tokens — Gemini 4 Argon, Gemini 3.1 Pro, Gemini 3.8 Flash and the Flash-Lite tier — with the long-context band, the cache rate and the service tiers, priced against every other model.

View Gemini API pricing →

Grok API Pricing

xAI Grok rates per 1M tokens — Grok 4.7 with its long-context band and cached-input rate, plus the retired Grok 4 row — priced against every other model.

View Grok API pricing →

MiniMax API Pricing

MiniMax M3.1 Flash and M3 rates per 1M tokens — a flat rate, the priority lane, the long-context doubling and the cache rate — priced against every other model.

View MiniMax API pricing →

Kimi API Pricing

Moonshot Kimi rates per 1M tokens — K3.1 Pro, the Highspeed twin and the still-sold K3, with the million-token window and the separately billed cache writes.

View Kimi API pricing →