TokenLedger
Token & API cost calculator

Know the token bill before the invoice.

Count a prompt on OpenAI's real tokenizer, price 22 models on the workload you actually run, and find the point where a $20 seat stops being cheaper than metered tokens. No account, no upload, nothing you paste leaves this tab.

22 models priced 3 tokenizer families 0 bytes uploaded 18 November 2026 price sheet

Workbench

Count it, price it, decide it

Three calculators, one price book. Everything runs in this tab.

Prices: 18 November 2026

Prompt A

Estimate ±5%
0 chars 0 words 0 lines
OpenAI · o200k_base0
Claude · estimate0
Gemini · estimate0

Prompt B optional

compare a rewrite
0 chars 0 words 0 lines
OpenAI · o200k_base0
Claude · estimate0
Gemini · estimate0
Tokens A → B —
Change —
Input cost per call —
Monthly difference at calls/day —
Input cost for Prompt A — One call, input tokens only
Prompt A per month — At 1,000 calls/day, 30 days

OpenAI counts become exact once the o200k_base vocabulary loads (about 3.6 MB, cached after the first time). Claude and Gemini stay estimates: their tokenizers are not public.

What it does

Three questions, answered before the invoice

TokenLedger is a ledger, not a playground. It does not call a model; it prices the ones you might call, with the numbers you actually send.

01

Count a prompt the way it is billed

Paste text and get characters, words, and token counts for three tokenizer families. OpenAI counts are exact once the o200k_base vocabulary loads; the fast estimate is calibrated to within about 5% on ordinary prose and code. Compare a rewrite side by side and see the cost difference per call and per month.

02

Price 22 models on the same workload

Input, output, cached input and batch rates for OpenAI, Anthropic and Google, applied to your calls per day, token sizes and cache-hit rate. One table, sorted by monthly cost, exportable as CSV or Markdown with the assumptions written into the file.

03

Find the crossover with seat pricing

A $20 seat and a metered key cross at a specific usage level. The calculator shows API cost per user, the team total, the break-even calls per day and the seat price that would match — plus a chart of where the two lines meet.

The arithmetic, in the open

How every number on this page is produced

There is no hidden model and no server-side guess. Cost per call is:

cost_per_call = ( (input − cached) × input_price
                + cached × cached_price
                + output × output_price ) / 1,000,000

monthly = cost_per_call × calls_per_day × billing_days

batch: multiply both prices by 0.5 before the division

Input tokens are split into cached and uncached parts by the cache-hit slider. That is a simplification of how providers actually bill: a cache only hits when the prefix is byte-identical, cache writes cost extra, and Google bills storage separately. For planning, the simplification is close enough; for a budget, add the buffer the simulator suggests.

A worked example you can reproduce

1,000 calls a day, 1,200 input and 350 output tokens, 40% of the input cached, 30 billing days:

ModelPer callPer monthPer year
GPT-6.2 Sol ($2 / $0.10 / $10)$0.004988$149.64$1,795.68
Claude Sonnet 5.5 ($2 / $0.10 / $10)$0.004988$149.64$1,795.68
Gemini 3.8 Flash ($0.75 / $0.075 / $3.75, intro)$0.001889$56.66$679.86
GPT-6.2 Astra ($8 / $0.40 / $40)$0.019952$598.56$7,182.72

The fourfold gap between Sol and Astra is the whole reason this page exists. It is also why the model choice matters more than the prompt micro-optimisation people usually start with.

Price book · 18 November 2026

What the models cost right now

USD per million tokens, Standard tier, short context, global endpoints, as published today. The full list of 22 models lives in the simulator above; this is the slice most teams are deciding between.

ProviderModelInputCachedOutputNote
OpenAIGPT-6.2 Astra$8.00$0.40$40.00Frontier; long context doubles input
OpenAIGPT-6.2 Sol$2.00$0.10$10.00Released 17 Nov 2026
OpenAIGPT-6-astra$10.00$1.00$50.00Previous frontier
OpenAIGPT-6 Luna$0.10$0.01$0.50High-volume classification
AnthropicClaude Fable 5.2$8.00$0.20$40.00Cache hits at 0.025× input
AnthropicClaude Opus 5.5$4.00$0.20$20.00Cache hits at 0.05× input
AnthropicClaude Sonnet 5.5$2.00$0.10$10.00Cache hits at 0.05× input
AnthropicClaude Haiku 5.5$0.10$0.01$0.50≤100K context
GoogleGemini 4 Hydrogen$1.50$0.075$7.50Cache storage billed hourly
GoogleGemini 4 Argon$2.00$0.10$10.00Intro to 30 Nov 2026; then $4 / $20
GoogleGemini 3.8 Flash$0.75$0.075$3.75Intro to 31 Dec 2026; then $1.50 / $7.50

Read the guide to the 2026 price sheet for what sits outside these numbers — cache writes, reasoning tokens, long-context multipliers and retries — or check the token counting guide for why the same paragraph costs different amounts in English and Korean.

Accuracy

What "estimate" and "exact" mean here

The OpenAI column has two modes. Before the vocabulary arrives it uses a calibrated estimator; afterwards it uses OpenAI's real o200k_base merges. The estimator's weights were fitted against 286 samples of prose, HTML, JavaScript, CSS, JSON, Korean, Chinese and Japanese text, then measured on a held-out set:

TextMean error9 in 10 within
Fitted corpus, 286 samples4.6%9.8%
Held-out English prose (23 samples)2.5%5.5%
Held-out JavaScript and CSS (70 samples)5.7%10.6%
Held-out JSON and numbers (3 samples)10.8%18.6%
Held-out Korean, Chinese, Japanese (4 samples)10.2%14.7%

Claude and Gemini counts scale the o200k figure by +10% and +2% respectively, because their vocabularies are not published. That is good enough to choose a model and wrong enough to matter on an invoice: use the provider's counting endpoint, or the usage numbers from a real week of traffic, for anything that will be reconciled.

Workflow

Five minutes, four steps

  1. Count the real prompt. Paste the system prompt plus one representative request, not a fragment. Tool schemas and history count too.
  2. Set the workload. Calls per day, input and output sizes, and the share of input that repeats. If you do not know the cache rate, start at 0% and treat the difference as the prize for fixing your prefix.
  3. Compare at least three models. One frontier, one at the $2/$10 price point, one small. The middle tier wins more often than either extreme.
  4. Export and keep the assumptions. The CSV and Markdown files carry the workload and the price date, so next quarter's comparison starts from what you assumed today rather than from memory.

When a number surprises you, the answer is usually in one of three places: output tokens billed as output on reasoning models, a system prompt resent on every call, or a price that stepped up after an introductory period.

FAQ

Questions people ask before trusting a number

Does TokenLedger send my prompts anywhere?

No. The estimator, the cost simulator and the subscription comparison all run as JavaScript in your tab. There is no backend that receives your text, no analytics product reading it, and no storage: close the tab and the prompt is gone. The only file the page fetches is OpenAI's public o200k_base vocabulary, and only after you start typing, so that exact counts can be computed offline on your machine. Your prompt text is never part of that request.

How accurate is the token estimate?

For OpenAI models the page can count exactly: once the o200k_base vocabulary has loaded, every OpenAI figure is a real byte-pair count, not a guess. The fast estimate used before that, and for Claude and Gemini, is a calibrated model: across 286 mixed samples of prose, HTML, JavaScript, CSS, JSON, Korean, Chinese and Japanese text it stayed within 4.6% of the real o200k count on average, and within 9.8% for nine samples out of ten. Very short strings (a word or two) can be off by a token, which matters more in percentage terms than in money. Dense JSON, long numbers and CJK text are the weak spots: 11–19% at the 90th percentile in our samples.

Why are Claude and Gemini counts marked with a ≈?

Anthropic and Google do not publish their tokenizer vocabularies, so nobody outside those companies can reproduce their counts byte for byte in a browser. The page scales the o200k count by a family factor (+10% for Claude, +2% for Gemini) taken from how those tokenizers behave on English prose. Treat those columns as planning numbers with roughly a 10% band, and use the provider's own count endpoint when a bill depends on the last token.

Which prices are in the table?

Standard-tier, short-context, global list prices in US dollars per million tokens, as published by OpenAI, Anthropic and Google on 18 November 2026. Cache-hit rates are the published cached-input prices. Batch pricing is applied as the 50% discount each provider offers. Introductory prices are in the table as they stand today and carry a note where they step up later — Gemini 4 Carbon and Argon move from $2/$10 to $4/$20 on 1 December 2026, and Gemini 3.8 Flash from $0.75/$3.75 to $1.50/$7.50 on 1 January 2027.

How is the monthly figure calculated?

Cost per call is (uncached input × input price + cached input × cached price + output × output price), divided by one million, then halved if batch pricing is on. Monthly cost is that number × calls per day × billing days. Annual cost is twelve months at the same volume. Nothing else is added: no retries, no evaluation runs, no embedding calls, no storage or egress, no committed-use discounts, no tax.

What is a cache hit rate, and why does it change the bill so much?

Providers let you resend a long, stable prefix — a system prompt, a policy document, a codebase summary — and charge the repeated part at a cached rate instead of the full input rate. On most current models that cached rate is 5–10% of the normal input price, so a workload with a large shared prefix can cut its input cost by more than half. The slider asks what share of your input tokens are repeats; it does not model cache writes, which are billed separately (and are usually more expensive than a normal input token).

Does the batch toggle apply to every provider?

The 50% figure is what OpenAI's Batch API, Anthropic's batch processing and Gemini's batch tier all charge relative to their standard rates. If you are mixing providers or using a tier that excludes batch (some preview models do), leave it off and read the result as standard pricing.

What is not in the cost model?

Things that quietly appear on real invoices: retries and agent loops that resend the same context, reasoning tokens (billed as output), tool and function schemas (billed as input on every call), image and audio tokens, embedding calls for retrieval, vector storage, cache-write tokens, long-context multipliers above the model's short-context threshold, minimum spend, and taxes. Add a 10–30% buffer on top of any estimate that will be used for a budget rather than a comparison.

All questions, including what the cost model leaves out →