Cost per million tokens

Last verified

LLM pricing is conventionally quoted per million tokens, with separate input and output rates — for example "$3 / $15", meaning $3 per million input tokens and $15 per million output.

To estimate a workload:

cost = (input_tokens / 1e6) * input_rate
     + (output_tokens / 1e6) * output_rate

Two adjustments that matter in practice: prompt caching can substantially reduce the effective input rate for repeated prefixes, and the Batch API typically discounts both rates for non-urgent work.

Comparing rates across providers is approximate, because each tokenizes differently.