Skip to content

Tech, EV & creators

AI Token Cost Calculator

Estimate your LLM API bill from tokens per request, per-million pricing and request volume, for any model, any provider.

Private · on device. Calculated in your browser, nothing you type is sent anywhere

Quick answer

Cost = tokens × price-per-million ÷ 1,000,000, computed separately for input and output. A million requests at 1,000 input + 500 output tokens, priced $3/M in and $15/M out, costs $10,500, output tokens usually dominate the bill despite being fewer.

Per million input tokens, from your provider’s pricing page.

Total cost
$1,050.00
Cost per request
$0.010500
Input cost
$300.00
Output cost
$750.00
Usually the larger share despite fewer tokens.

Enter the prices from your provider’s current pricing page, they change often, which is exactly why this calculator asks rather than assumes. Rough sizing: a token is ~4 characters of English, so a page of text is ~400 tokens.

Formulas last verified 2026-10-10. Results are estimates, not financial advice. How we calculate.

How API billing works

Every LLM provider bills the same way: you pay per token, at separate rates for input (what you send) and output (what the model generates), quoted per million tokens. The whole calculation is one line, applied twice:

cost = tokens × price-per-million ÷ 1,000,000

A token is roughly 4 characters of English text, about three-quarters of a word. So a 1,000-token prompt is around 750 words, and a 500-token response is a solid few paragraphs.

Worked example

Say your product makes 1,000,000 requests a month, each sending 1,000 input tokens and receiving 500 output tokens, on a model priced at $3/M input and $15/M output:

DirectionTokens/requestPriceMonthly cost
Input1,000$3 / M$3,000
Output500$15 / M$7,500
Total1,500-$10,500

Notice the shape of that bill: output is a third of the tokens but 71% of the cost. That asymmetry is the single most useful thing to know about LLM pricing, the model's verbosity, not your prompt length, is usually what you are paying for.

Why we ask for prices instead of assuming them

This calculator deliberately has no built-in model price list. Provider pricing changes monthly: models launch, prices drop, tiers appear, old models retire. A hardcoded table would be quietly wrong within weeks, and a cost estimate built on stale prices is worse than no estimate. Instead, you paste the current per-million prices straight from your provider's pricing page, and the arithmetic is guaranteed current. It also means the page works for every provider and every model, including the ones that don't exist yet.

The levers that actually cut the bill

  1. Cap output length. Output is the expensive direction. Set a max-tokens limit, ask for concise answers, and stop paying for prose nobody reads.
  2. Route easy requests to a cheaper model. Most workloads are a mix: classification, extraction and short answers rarely need a frontier model. A 10× price gap between model tiers is common, routing even half your traffic down a tier roughly halves that half of the bill.
  3. Use prompt caching. If every request re-sends the same system prompt, instructions or reference documents, caching bills those repeated tokens at a steep discount (often 90%). For long shared prefixes this is close to free money.
  4. Trim the prompt. Boilerplate instructions, redundant examples and over-long context all bill at full input rate on every single request. A 200-token trim across a million requests is 200M tokens saved.
  5. Batch what can wait. Batch endpoints typically run at around half price in exchange for minutes-to-hours latency, ideal for backfills, evaluations and nightly jobs.

Estimating your token counts

For planning, count characters and divide by 4, a page of English text (~3,000 characters) is roughly 750 tokens. Code and non-English text run heavier. If you already have traffic, your provider's usage dashboard shows real per-request averages; feed those into the calculator rather than guessing.

Putting the cost in context

Per-request costs look tiny, the example above is about a cent per request, which is exactly how bills sneak up: nothing is expensive until you multiply by a million. Model the volume you expect at scale, not the volume you have today. If you are pricing API costs into client work, the freelance rate calculator helps make sure expenses like this end up in your rate rather than your margin. For the revenue side of a content business, the YouTube earnings calculator applies the same honest-inputs approach, and the percentage calculator is handy for working out what share of your unit economics the model bill represents.

Frequently asked questions

How is LLM API cost actually calculated?

Per direction: cost = tokens × price-per-million ÷ 1,000,000, computed once for input tokens and once for output tokens, then added. Providers price the two directions differently, output is typically 3–5× the input price, so a request's cost depends on both how much you send and how much the model writes back. Multiply by request volume for the monthly bill.

How many tokens is my text?

For English prose, roughly 4 characters (about ¾ of a word) per token, so a 1,000-word prompt is around 1,300 tokens. Code, non-English languages and unusual formatting tokenize less efficiently and can run 1.5–2× that. For billing-grade numbers use your provider's tokenizer tool; for capacity planning, the 4-characters rule is close enough.

Why do output tokens dominate my bill?

Two reasons compound: output is priced several times higher per token, and generation is what you asked the model to do, long answers, code, or documents. At $3/M input and $15/M output, 500 output tokens cost $0.0075 per request while 1,000 input tokens cost $0.003, the shorter direction costs 2.5× more. Capping response length is usually the single biggest lever.

Why does this calculator ask for prices instead of listing models?

Because provider pricing changes monthly, new models launch, old ones get cut or deprecated, and any hardcoded price table goes stale within weeks. Asking for the current per-million prices (copy them from your provider's pricing page) means the estimate is always computed against reality, not against a snapshot. It also works for any provider, including ones that launch tomorrow.

How do I cut my LLM API costs?

In rough order of impact: cap and trim output length; use a smaller, cheaper model for the easy majority of requests and reserve the frontier model for hard ones; enable prompt caching if you resend the same system prompt or documents; shorten prompts by removing boilerplate; and use batch endpoints (often ~50% off) for anything that can wait minutes instead of seconds.

Is the estimate exact?

It is exact for the token counts and prices you enter, the formula is the same one your provider bills with. The uncertainty is in your inputs: real token counts vary per request, and features like caching discounts, batch pricing or long-context surcharges modify the effective rate. Estimate with your average request, then compare against the provider's usage dashboard after a few days.

Related calculators