Token cost

The price of the input and output tokens a request consumes.

LLM providers bill per million tokens, usually with different input and output rates. Token cost = (input tokens × input rate + output tokens × output rate). Output tokens are often several times more expensive than input.

Why it matters

Token cost is the atom of your variable cost. Get it right per request and everything above it — per-customer cost, margin, pricing — follows; get it wrong and every projection is off.

Example

1M input + 0.3M output on Claude Sonnet ($3 / $15 per Mtok) = $3.00 + $4.50 = $7.50 — the 0.3M of output costs more than the full 1M of input.

Calculate it with the free margin calculator →

Related terms