The formula
cost = input ÷ 10⁶ × input price + output ÷ 10⁶ × output price
Where it comes from
A language model charges per token, and it charges differently by direction: output costs several times more than input. That flips the intuition: a five-hundred-token reply costs more than a fifteen-hundred-token context, even with a third of the tokens. So the page separates the two lines and says what share of the cost is output, which is the figure that decides whether to ask for shorter replies or trim the context.
How to work it out by hand
- Divide the input tokens by a million and multiply by their price
- The same for the output tokens, at their price
- Add the two: that is the cost of one request
- Multiply by requests a day and by thirty
What is worth knowing
Context caching charges a discounted rate for the part of the input repeated between requests — system instructions, long documents — and only that part: if half the input comes from cache at a 90 % discount, input costs 45 % less and output exactly the same. On words: a token is about three quarters of a word in English and a little less in other languages, because long words and accented letters split into more pieces. The figure the page gives is for a rough idea, not for invoicing.