← All toolsTools

AI token cost calculator

Free, instant, no signup. Paste a prompt to count its tokens, or set the input, output and cached tokens per request and your monthly volume, and get per-request and monthly API cost across 21 Claude, GPT and Gemini models — each one next to its provider's list price. Rates are read live from the catalog.

Your workload

Estimate for Claude Sonnet 5: Anthropic does not publish Claude's tokenizer, so this is OpenAI's o200k_base count. Anthropic's free count_tokens endpoint returns Claude's own number.Counted in your browser — nothing you paste leaves this page.

Quick presets

Rate: $1.40 in / $7.00 out · cache hit $0.1400 · cache write $1.75 — all per 1M tokens, read live from the Kunavo catalog.

Estimated cost

Per request$0.00350
Per month (Kunavo)$350
Per month at Anthropic list$500

You save vs Anthropic list

$150/ month · ~30%

Run this workload on Kunavo

Pay as you go from $10, failed calls not billed. The dashboard opens with this model in a ready-to-run request.

Estimate only. Reasoning models bill hidden reasoning tokens at the output rate, so a reasoning workload costs more than the output box suggests. Cache writes are billed separately at $1.75 per 1M and are not in this figure — they are a one-off per cache entry, not per request. Failed requests are never billed.

Measured: one coding task, start to finish

Our own test on Oct 10, 2026, not a customer's: the same small repo task — make a six-test unit suite pass, five of them failing at the start — run headless in two coding agents against Kunavo. "Cost" is the run at Kunavo's rates, read from our usage log; one OpenCode call was missing from that log and went uncharged, and it is counted here at the same rates.

ClientModelModel callsTimeInput (cache read / write)OutputCost
OpenCode 1.18.35Claude Sonnet 553:0353,077 (26,999 / 24,212)3,976$0.0766
Cline CLI 3.0.70Claude Sonnet 541:5845,171 (30,855 / 14,181)5,301$0.0664
Cline CLI 3.0.70GPT-5.6 Terra61:0149,835 (35,328 / 0)2,298$0.0223

At these sizes, $10 pays for about 130–448 runs of this task.

Embed this calculator on your site

Free to embed in a blog post or your docs. Prices follow Kunavo's live catalog, and links open kunavo.com in a new tab.

<iframe src="https://kunavo.com/embed/llm-cost-calculator" title="AI token cost calculator" width="100%" height="760" style="border:0;border-radius:16px;max-width:720px" loading="lazy"></iframe>

If you do not know your own token shape yet

Do not guess it from character counts. Log usage.prompt_tokens and usage.completion_tokens from a day of real traffic — every OpenAI-compatible response carries them — and put those numbers in above. Until then the presets encode realistic shapes: a support reply is light at roughly 800 in and 200 out, a RAG answer carries retrieved context at roughly 6,000 in and 500 out, one coding-agent step is heavier at 20,000-plus in, and long-document analysis is input-dominated.

Four levers that shrink the number

Prompt caching. A large stable system prompt or knowledge block bills at a fraction of the input rate once cached. For prompt-heavy applications this is the largest single lever there is — larger than switching models — which is why the calculator above has a cached-tokens field at all.

Model tiering. Route easy calls to the cheapest model that can do them and reserve the frontier tiers for the hard fraction. Set two models in the picker above and the delta is immediate.

Cap max_tokens. Output costs several times input across every family here, so unbounded generation is unbounded spend. This is the one control that needs no measurement first.

Trim retrieval. Fewer, better-ranked RAG chunks cut input tokens without hurting answer quality, and input is where a retrieval app spends.

Go deeper

Pricing guides for each model family

Frequently asked questions

How do you calculate the cost of LLM tokens?

LLM API cost is priced per million tokens, with input and output billed at different rates, so the cost of one request is (input tokens ÷ 1,000,000 × input rate) + (output tokens ÷ 1,000,000 × output rate). Output is typically several times more expensive than input, which is why a short prompt with a long answer can cost more than a long prompt with a short one. Monthly cost is that per-request figure multiplied by request volume, and cached input adds a third term at a fraction of the input rate.

Does this token cost calculator count tokens from text?

Yes. Paste a prompt or a document into the box above the inputs and it is counted in your browser with o200k_base, the tokenizer of OpenAI's GPT-4o and GPT-5 models; one click moves the count into the input or the output field. It is exact for the GPT models that tokenizer is confirmed for and an estimate for Claude and Gemini, and the note under the box says which applies to the model you picked. For traffic you already send, the usage field of your API responses is still the number you are billed for.

Is this token cost calculator free?

Yes. The token cost calculator is free, runs in the browser, and requires no signup or API key. Rates are read live from the Kunavo model catalog, and each model is shown next to its provider's published list price so the comparison is checkable against the provider's own pricing page.

Which LLM API is cheapest for my workload?

It depends on the input-to-output ratio, and that is the reason to compare rather than assume. A workload that ships long context and returns short answers is dominated by the input rate; a workload that generates long text is dominated by output, where the spread between tiers is widest. Set your own token counts above and read the monthly column — the cheapest model on a summarisation job is often not the cheapest on a chat job.

Why is my real API bill higher than the calculator says?

Three things a per-request estimate leaves out. Reasoning tokens are billed as output even though they never appear in the response. Cache writes are billed once per cache entry and sit outside the per-request figure. And retries are billed: a failed request that consumed tokens still counts. Agentic tools are the widest gap, because one user-visible task is many billed round trips.