Infographic · AI cost foundations
What a prompt really costs, and where the money goes.
Every call to a language model is billed per token. Most people look at the input. The bill is mostly in the output.
- per 1M input tokens
- $2
- per 1M output tokens
- $10
- of the first question's cost was output
- 97%
Input vs output
An output token costs 5 times as much as an input token
Reading is cheap. Writing is expensive. Each square below is one dollar, for one million tokens on Claude Sonnet 5.5.
The first question in the exercises
Shape of the work
The type of task decides which meter runs hardest
A chat answer is long, so output dominates. Classifying thousands of texts is the reverse: long inputs, a one-word answer.
Where it goes
Try it: one request, split into input and output
Move the sliders. Unless the input is many times longer than the output, the amber part stays dominant.
- per request
- $0.021
- per 1,000 requests
- $20.60
Defaults: a short question (300 tokens) and a long answer (2,000 tokens). That gives the 97/3 split from chapter 01.
Count first
Counting is free, and it is exact
The count endpoint tells you the token total before you send anything. In the exercises it matched the bill to the token.
- tokens predicted by
count· free - 29
- tokens billed by
live - 29
Every message comes in a wrapper
Tokenizer & language
Every model counts differently, and Dutch costs more
An online counter built on another tokenizer guessed about half. And the same meaning in Dutch takes more tokens than in English.
Same meaning, two languages
Reasoning
Thinking tokens are invisible, but billed as output
Ask a harder question and the model thinks before it answers. You never see that text. You do pay for it, at the output price.
Effort is a cost dial
effort sets the ceiling.Saving
Cut the answer, not the question
Halving the output saves far more than halving the input. Ask for shorter answers, structured output and no repetition of the question.
Caching
Pay a little extra once, then reuse almost free
A cache write costs 25% more than normal input. Every read after that gets 90% off. One reuse is enough to break even.
- input, per 1M tokens
- $2.00
- cache write · +25%
- $2.50
- cache read · −90%
- $0.20
Cumulative cost of the same prompt prefix
Pitfall: input_tokens hides the cache
input_tokensinput_tokens, while 2,960 were processedcache_read_input_tokens and cache_creation_input_tokens too, or the dashboard looks too good to be true.The limit: caching never touches output
Batch
Half price, if you can wait
Send requests as a batch and the answer arrives later, at 50% off. For work nobody is waiting on, that is free money.
Estimate
You can know the bill before you build
Three numbers are enough: tokens in, tokens out, and how often it runs.
With 300 input and 2,000 output tokens per request, from chapter 03.
- per month, at 10,000 requests
- $206.00
- per year
- $2,472
Outlook
Today's price is not the real price
AI is heavily subsidised right now. That will not last. Plan with a margin: what does the same workload cost if prices go up?
Check the source
Prices, model IDs and APIs go out of date
A forecast is only as good as the price table under it. Four checks from the exercises.
| Sonnet 5.5 | Input | Cache write | Cache read | Output |
|---|---|---|---|---|
| per 1M tokens | $2 | $2.50 | $0.20 | $10 |
- Verify prices against the sourceThe example prices and model IDs in
pricing.jsonwere wrong. Quick check: work out the cost of 1M tokens; it should equal the price per MTok. - An illogical result means a reading errorA cache read can never cost more than input. If the numbers say otherwise, re-read the table.
- The API changes under you
budget_tokensno longer works on Sonnet 5.5. Adaptive thinking witheffortreplaced it. - A subscription is not API creditA Pro subscription does not cover API use. That is billed separately, through the Console.
Common thread
Measuring beats assuming.
Almost every insight came from a number that turned out different than expected.
Contact
Want to see what your AI workflow really costs, before the subsidies end?
Get in touchSource · costlab exercises, module 1 · Claude Sonnet 5.5 · prices checked September 29, 2026