What Is the Difference Between Input, Cached Input, and Output Tokens in LLM Pricing?

Updated

LLM pricing splits a single request into three separately billed token categories: input tokens (the prompt you send), cached input tokens (prompt content the provider reuses instead of reprocessing), and output tokens (the completion the model generates). Each category carries its own price per million tokens, and output is almost always the most expensive. The LLM pricing calculator on llm-prices.com exposes exactly these three fields, so you can price a request by entering a token count for each and reading the total.

The three token categories

Input tokens (prompt tokens)

These are the tokens in everything you send to the model — system instructions, conversation history, retrieved documents, and the user's message. You pay for them once per request, at the model's input rate. In the calculator this is the "Number of input tokens (aka prompt tokens)" field, priced by "Cost per million input tokens ($)".

Cached input tokens

When part of your prompt repeats across requests (a long system prompt, a fixed document, a shared prefix), providers can store that processed content and reuse it. Those reused tokens are billed at a lower rate than fresh input. The calculator gives them their own field — "Number of cached input tokens" — and their own rate, "Cost per million cached input tokens ($)". Caching only helps if the same prefix actually recurs; a one-off prompt has nothing to cache.

Output tokens (completion tokens)

These are the tokens the model generates in response. They are typically priced higher than input, because generation is the more expensive operation. In the calculator they map to "Number of output tokens (aka completion tokens)" and "Cost per million output tokens ($)".

Why the split matters

A request's total cost is the sum of three separate multiplications, not one flat rate:

total = (input_tokens      / 1,000,000 × input_price)
      + (cached_tokens     / 1,000,000 × cached_price)
      + (output_tokens     / 1,000,000 × output_price)

Two consequences follow:

  • A long prompt and a long answer are not priced the same. If output costs several times input, trimming the completion saves more than trimming the prompt.
  • Caching changes the math on repeated prompts. The same system prompt sent a thousand times costs less per call once it is cached, because the cached portion is billed at the reduced rate.

A concrete example

Suppose a model charges $3 per million input tokens, $0.30 per million cached input tokens, and $15 per million output tokens. A request with 2,000 input tokens, 1,500 of them cached, and 500 output tokens costs:

  • Input: 500 fresh tokens × $3/M = $0.0015
  • Cached: 1,500 tokens × $0.30/M = $0.00045
  • Output: 500 tokens × $15/M = $0.0075
  • Total ≈ $0.00945

Note that the 500 output tokens cost more than all 2,000 input tokens combined — the typical pattern when output is priced highest.

One caveat the calculator itself flags

The tool notes that different models use different tokenizers, so direct token-based price comparisons across models "may not be entirely accurate." The same text can produce different token counts on different models, which shifts the real cost even when the per-million rates look comparable. Treat the calculator's output as a consistent estimate for one model, not a precise cross-model ranking.

How to use this in the calculator

  1. Enter the number of input tokens for your prompt.
  2. Enter how many of those are cached (0 if nothing repeats).
  3. Enter the expected number of output tokens.
  4. Fill in the three per-million prices for your model.
  5. Read the Total cost.

The "Model prices (per million tokens)" table below the calculator lists input, cached, and output rates per model, and you can filter it with "Show just selected" or reset it with "Clear selection" to compare candidates on the same three dimensions.