A

Glossary

AI Token Pricing

AI token pricing is the per-unit rate model where a provider charges separately for input tokens and output tokens consumed by a language model, quoted per million tokens. Output rates run several times input rates, and cached input bills at a fraction of the base rate.

Key Takeaways

  • Input and output are priced as separate line items, and treating them as one blended rate produces a cost estimate that's wrong by multiples.

  • On short-context rates the output premium runs 5x to 8x base input, from 5x on Claude Sonnet 5 to 8x on gpt-5-mini. Long-context tiers compress it to about 4.5x.

  • Cache reads bill at 10% of base input on current models, while a 5-minute cache write costs 1.25x base input and a 1-hour write costs 2x.

  • Token counts aren't portable between models. Claude 4.7 and later use a tokenizer producing roughly 30% more tokens for the same text than earlier Claude models.

  • Anthropic's Batch API discounts input and output 50% in both directions, so the same workload has two legitimate prices depending on whether it's synchronous.

How is token pricing calculated?

Token pricing multiplies each token category by its own rate and sums the results, so a single request usually produces at least two charges.

The calculation on a request with 50,000 input tokens and 15,000 output tokens against Claude Opus 5, at $5 per million input and $25 per million output:

  • Input: 50,000 x $5 / 1,000,000 = $0.25

  • Output: 15,000 x $25 / 1,000,000 = $0.375

  • Total: $0.625

Add prompt caching and the input side splits again. If 40,000 of those input tokens are cache reads billed at 10% of base, the input cost falls to 10,000 x $5 / 1,000,000 plus 40,000 x $5 x 0.1 / 1,000,000, which is $0.05 + $0.02 = $0.07. Total drops to $0.445, a 29% saving on the same request.

For rough sizing before any of that, one token runs about 4 characters or 0.75 words in English.

Why do output tokens cost more than input tokens?

Output costs more because generation is sequential while input processing is parallel, and every provider prices that difference in.

The gap is consistent and large across Anthropic and OpenAI published rates:

Model

Input per 1M

Cached input

Output per 1M

Output multiple

Claude Haiku 4.5

$1.00

$0.10

$5.00

5x

Claude Sonnet 5

$2.00

$0.20

$10.00

5x

Claude Opus 5

$5.00

$0.50

$25.00

5x

gpt-5.6-terra

$2.00

$0.20

$12.00

6x

gpt-5.6-sol

$5.00

$0.50

$30.00

6x

gpt-5-mini

$0.25

$0.025

$2.00

8x

Those OpenAI figures are short-context rates. Long-context tiers on gpt-5.6-terra and gpt-5.6-sol run $4.00 and $10.00 input against $18.00 and $45.00 output, compressing the multiple to 4.5x. Anthropic prices its full 1M-token window at the standard rate, so a 900k-token request costs the same per token as a 9k-token one.

The practical consequence is that workload shape matters more than model choice for cost. A summarization job reads a lot and writes a little, so it lands near the input rate. A code generation job inverts that and lands near the output rate. Two customers on identical token counts can differ several-fold in what they cost you to serve.

What goes wrong when you resell tokens?

Reselling tokens at a flat markup fails when your customer's workload shape differs from the shape you priced against.

The failures that recur:

  • Blended-rate pricing. Quoting one price per million tokens without separating input from output means output-heavy customers destroy margin while input-heavy ones overpay.

  • Ignoring cache economics. If you bill customers base input on tokens you served from cache at 10%, that's fine until they ask. If you pass through your cached rate without accounting for the 1.25x or 2x write, you lose money on short-lived caches.

  • Tokenizer drift. Priced against one model's token counts, then migrated to a newer model producing roughly 30% more tokens for the same text, your per-token revenue holds while your cost per request climbs.

  • Context-tier mismatch. Where a provider charges more per token above a context threshold, your cost steps up on long prompts while your price per token stays flat.

  • Batch mismatch. Buying at the 50% batch discount and selling at synchronous rates is a real margin source, but only for work that genuinely tolerates asynchronous processing.

We'd separate input and output on the invoice for exactly this reason. It makes the customer's own cost drivers visible and stops a single blended rate from hiding which accounts are worth serving.

Related reading

Further reading on token cost and metering:

FAQ

How many tokens are in a word?

About 1.3 tokens per English word, or roughly 4 characters per token. The ratio shifts with content type and language: code and non-English text tokenize less efficiently, so the same character count produces more tokens. Use the ratio for sizing only, and count real tokens with a token counting endpoint before you commit to a price.

Does prompt caching actually save money?

Yes, once the cache gets read. A cache read costs 10% of base input, but writing the cache costs 1.25x base input for a 5-minute window or 2x for an hour. That means a 5-minute cache pays for itself after one read and a 1-hour cache after two. A cache that's written and never read is pure added cost.

Do different models count tokens the same way?

No. Tokenizers differ between model families and between generations of the same family. Claude 4.7 and later models use a newer tokenizer that produces roughly 30% more tokens for identical text than earlier Claude models. Any cost forecast built on one model's counts needs recalculating before you switch.

Back to glossary

Get Instant Feedback on Your Pricing | Join the Flexprice Community with 400+ Builders on Slack

Join the Flexprice Community on Slack