How LLM API Pricing Works

Tokens, input vs output, context windows — why the same task can cost 50× more on one model than another, explained simply.

HomeLearn › How LLM API Pricing Works

Everything is priced per token

LLM providers don't charge per request or per word — they charge per token. A token is a chunk of text, roughly ¾ of a word in English (about 4 characters). "APICostCalc is useful" is ~5 tokens. Both the text you send (input) and the text the model generates (output) are counted, and they're usually priced differently.

Token cost calculator →

Input vs output — output is the expensive one

On almost every model, output tokens cost more than input tokens — often 3–5× more — because generating text is more compute-intensive than reading it. This is why a chatbot that writes long answers costs far more than one that classifies text into a single word, even at the same request volume.

Cost driverEffect on bill
Long system prompt sent every callInput tokens multiply by request count
Verbose model answersOutput tokens — the priciest kind
Large context (RAG chunks, history)Input tokens balloon fast
Reasoning / "thinking" modelsHidden reasoning tokens billed as output

The context window is a cost ceiling, not a free space

A model's context window (e.g. 128K or 1M tokens) is the maximum it can read at once — but every token you put in it is billed on every call. Stuffing a whole document into context each request is convenient and expensive; that's the problem RAG and caching solve.

Context window cost →Reasoning token cost →

Why the same task varies 50× between models

Frontier models can cost tens of dollars per million tokens; small or open models a few cents. If a cheap model handles the task at acceptable quality, you can cut cost by an order of magnitude with one line of config. The skill is matching model strength to task difficulty — see the cost-cutting guide.

Compare model prices →

Frequently asked questions

What is a token in an LLM API?

A token is a small chunk of text the model processes — in English, roughly ¾ of a word or about 4 characters. Providers bill per token for both the text you send (input) and the text the model generates (output).

Why do output tokens cost more than input tokens?

Generating text requires more computation than reading it, so providers price output tokens higher — commonly 3–5× the input rate. This makes verbose model responses a major cost driver.

Does a bigger context window cost more?

Only for the tokens you actually use. The window is a maximum capacity, but every token you place in context is billed on each call, so sending large prompts repeatedly gets expensive fast.

How can the same task cost 50× more on one model?

Model prices per million tokens vary enormously between frontier and small/open models. If a cheaper model meets your quality bar for a given task, switching to it can cut costs by an order of magnitude.

Educational reference only — prices are estimates; confirm current rates on each provider's pricing page.