Utilumo
LightDarkSystem
Explainer1 min readUpdated June 29, 2026

How AI token pricing works

Short answer

Most AI APIs charge per token, not per request. You pay for the tokens you send (input) plus the tokens the model generates (output), usually at different rates, with output often more expensive. Cost scales with how much text moves in and out.

You pay per token

AI APIs are billed by the token rather than per call. The cost of a request is the number of input tokens plus output tokens, each multiplied by its price. Since a token is roughly four characters of English, long prompts and long answers both add up. See What is a token in AI language models?.

Input and output are priced separately

  • Input tokens: everything you send, including system instructions and context
  • Output tokens: everything the model generates in reply
  • Output usually costs more per token than input
  • Rates vary by model and provider, so the same text costs different amounts on different models
Estimate before you runCounting tokens ahead of time turns a vague 'this might be expensive' into a number. It also helps you keep within a model's context window.
Try it: AI Cost CalculatorEstimate the cost of a request from input and output token counts locally.Open tool

Ways to reduce cost

  • Trim unnecessary context from the prompt
  • Ask for shorter output when you do not need length
  • Reuse cached or summarized context instead of resending everything
  • Pick a smaller model when the task does not need the largest one

References

Questions

Why is output more expensive than input?

Generating text is more computationally demanding than reading it, so many providers price output tokens higher than input tokens. Exact rates depend on the model and provider.

How do I estimate cost before sending a request?

Estimate the input and output token counts, then multiply each by its per-token price for your chosen model. A cost calculator does this arithmetic for you.

Does the cost calculator contact a provider?

No. It estimates cost locally from token counts and the rates you enter, and contacts no model or server.

Keep reading