AI API Token Cost Calculator

Estimate AI API costs from token counts and the per-million rates you enter.
Compare two models, split input against output, and project monthly spend.

AI API Cost Estimate

How the pricing works

Large language model APIs bill per token, where a token is roughly four characters or three quarters of an English word. Rates are quoted per million tokens and split in two: input tokens are everything you send, output tokens are what the model writes back. Output is always the dearer of the two, typically three to five times the input rate, because generating text costs the provider far more than reading it.

You supply the rates here rather than picking a model from a list. That is deliberate. Model lineups and prices change every few months, and a calculator with last year’s numbers baked in quietly gives you a wrong budget. Copy the two figures off your provider’s pricing page and they will be right on the day you use them.

The arithmetic

  • Cost per request = (input tokens × input rate + output tokens × output rate) ÷ 1,000,000
  • Daily cost = cost per request × requests per day
  • Monthly cost = daily cost × 30

Estimating your token counts

  • 1,000 tokens is about 750 words, call it a page and a half
  • A short question carrying some context: 500 to 2,000 input tokens
  • A detailed answer: 200 to 1,000 output tokens
  • Code runs more tokens per word than prose, because identifiers and punctuation fragment
  • Non-English text is usually worse again, sometimes two or three times the tokens for the same meaning

Do not guess if the bill matters. Every provider ships a tokenizer, and running your actual prompts through it takes ten minutes and beats any rule of thumb.

What the rates look like in practice

Exact prices go stale fast, so treat this as shape rather than fact, and check the provider’s page before committing to a budget:

Tier Rough input, per 1M Rough output, per 1M What it is for
Small / fast under $1 $1 to $5 classification, extraction, routing, summarising
Mid $1 to $5 $5 to $20 most production work
Frontier $5 to $20 $20 to $80 hard reasoning, long agentic chains, code

The spread between the tiers is the single biggest lever on your bill, usually far bigger than any prompt tuning.

Where the money actually goes

Run your numbers above and look at the input against output split. Most people are surprised: if you are sending a large system prompt and getting short answers back, input dominates despite the lower rate, and the fix is caching rather than a cheaper model. If you are generating long documents, output dominates and a cheaper model or a shorter response format saves more than trimming the prompt ever will. Optimise the bigger half.

Cutting the bill

  • Route by difficulty. Most production traffic does not need a frontier model, and a small model handling the easy 80% with an escalation path is the standard pattern.
  • Cache repeated prefixes. If your system prompt is identical on every call, prompt caching cuts the cost of that portion sharply. This is the highest-value change for most chat applications.
  • Batch anything that is not interactive. Providers commonly discount asynchronous work by around half.
  • Trim conversation history. Sending the full transcript on every turn makes cost grow with the square of the conversation length.
  • Cap output length. An unbounded max-tokens setting is how a summarisation job turns into an essay-writing job.

One caveat on the numbers this page produces. It multiplies daily cost by 30, which assumes steady traffic. Real usage is spiky, and a launch or a retry loop can produce a month’s budget in an afternoon, so set a spend limit at the provider rather than trusting the projection.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.