Home / Guides / What Is a Token? How to Calculate Your AI API Costs

What Is a Token? How to Calculate Your AI API Costs

2026-12-01 · AI Costs

The short version

AI APIs do not charge per request or per word. They charge per token. Text you send is billed as input tokens, text the model returns is billed as output tokens, and output usually costs several times more than input. Once you understand that, you can estimate what any AI feature or automation will cost per month before you build it.

What a token actually is

A token is the chunk of text a model processes. As a rough guide, one token is about 4 characters of English text, or about three-quarters of a word. The exact split depends on the model tokenizer, but precision is not the point. The point is what counts: your prompt, your system instructions, every document you attach, and the entire conversation history all burn input tokens, and the longer the reply, the more output tokens you pay for.

The most overlooked cost is conversation history. In a multi-turn chat, each new turn resends everything before it, so input costs snowball. The same question asked in a fresh conversation and asked at the end of a long one can differ in cost by an order of magnitude.

How pricing works: per million tokens

Every major provider lists prices per million tokens (per 1M), with separate input and output columns. Based on official pricing pages in late November 2026, mid-tier models cluster around $2 input / $10 output per million tokens. Flagship models run about $8 / $40, and lightweight models go as low as $0.10 / $0.50. That is up to an 80x spread, so check whether your task actually needs a flagship model before you default to one.

The formula is simple:

Cost per request = (input tokens / 1,000,000) x input price + (output tokens / 1,000,000) x output price

A worked example

Say you build a document summarizer: each run sends 10,000 input tokens and returns 2,000 output tokens. On a mid-tier model at $2 / $10, one run costs $0.04 + $0.02 = $0.06. At 20 runs a day, 22 days a month, you are at $26.40 per month, or $316.80 per year.

Now swap the model. The same workload on a flagship model at $8 / $40 costs $105.60 a month. On a lightweight model at $0.10 / $0.50, it costs $1.32 a month. Summarization rarely needs a flagship model, so the model choice alone is worth over $1,200 a year here. That is why “calculate first, then pick the model” is lesson one of API cost control.

Run your own numbers in our AI Token Cost Calculator — it compares rates instantly without a spreadsheet.

Three reasons your bill will not match the estimate

Cache discounts. When you resend the same content repeatedly (a fixed system prompt is the classic case), most providers offer heavily discounted cached-input pricing. High-repetition workloads can land far below the standard-rate estimate.

Batch APIs. Jobs that do not need an instant answer — nightly reports, bulk summaries, classification — often get roughly 50% off through batch endpoints.

Long-context surcharges. Several models raise their rates once input passes a threshold (272K tokens is a common one). Before you paste an entire manual into a prompt, read the long-context line on the pricing page.

Subscription or API: which is cheaper for you?

For personal use — daily questions, writing help — a flat subscription is simpler and cannot surprise you. For a product or an automation, API billing scales with usage and integrates into your stack. To see your full picture, add both sides together: subscriptions in the AI Subscription Cost Calculator, API usage in the token calculator.

FAQ

Can I rely on free tiers long-term? New-account free credits are usually one-off or time-limited. Never build a product cost structure on top of them.

How do I estimate tokens for my text? Roughly 4 characters per token for English prose, plus a 20% buffer. For precision, use the provider’s official tokenizer on your real text.

How often do prices change? Constantly — new models and promotions reset the table every few months. Our calculator presets cite the official source and the date we checked them; re-verify before you budget.

Sources

Try it yourself: open the matching calculator and run the numbers with your own usage.