1 of 5 · Start here
Tokens are the meter
Before a language model can answer, it cuts your message into pieces called tokens. Providers count those pieces on the way in and again on the way out. Three short activities show the cut and what it does to cost.
- Input
- The tokens the model reads
- Output
- The tokens the model writes
- Cost
- Tokens × number of uses × rate
Start here · The whole machine
One answer takes many trips
Your message enters as text. The tokenizer cuts it into tokens, and the rest of the model works with those tokens. At the far end, the model picks one new token and adds it to the text.
Then the machine runs again to pick the next token, and again for the token after that. The input meter counts your message once. The output meter counts each new token that the model writes.
Follow the tokens through the front of the machine. Watch the output counter go up by one on each trip.
Keep two ideasThe model receives tokens, not words. It makes one trip for every token that it adds to the answer.
Activity 1 · See the meter
Put a sentence through the tokenizer
A token can be a whole word, part of a word, a number, or a punctuation mark. Common text often fits into large pieces. Less familiar text often breaks into more pieces. More pieces mean more tokens on the bill.
Pick a sample and look at the pieces. Then type your own sentence and watch the token count change.
- ␣the
- ␣model
- ␣reads
- ␣the
- ␣text
- ␣and
- ␣predicts
- ␣the
- ␣next
- ␣token
Most common words fit into one piece in this teaching tokenizer.
- Words
- 10
- Tokens
- 10
- Extra pieces
- 0
| Cost at the example rates | 1 use | 1,000 uses | 1 million uses |
|---|---|---|---|
| To send this text$5 per million tokens | <$0.01 | $0.05 | $50.00 |
| To write this much$25 per million tokens | <$0.01 | $0.25 | $250 |
Activity 2 · Test your instinct
Which message costs more?
You do not need to guess an exact count. Pick the message that you think uses more tokens. The reveal shows both counts and the monthly cost if a service sends that message one million times.
Read A and B, then pick the one that you think costs more. There are three rounds.
Activity 3 · Change the bill
Get the monthly bill below $55,000
A help-desk assistant handles 100,000 requests a day. Each request carries the same instructions, some background material, and an answer. The bill starts at $82,500 a month. Choose any two changes.
Throw two levers. Watch which part of the bill shrinks, and check whether you reach the target.
- Instructions
- $22,500
- Background
- $30,000
- Answers
- $30,000
- Total · target $55,000
- $82,500
Choose two changes to reach the target.
Output tokens cost five times as much as input tokens at this example rate. That is why the shorter answer saves the most, although it removes the fewest tokens.
Next · The middle of the machine
What happens between the cut and the answer
Activity 1 ends where the model's work begins. Each token becomes a list of numbers. The transformer mixes information across the whole message. Then the model scores every possible next token and picks one. That one pick is one output token on the bill, and the machine goes around again.
To see these steps, read How a language model turns text into the next token. For a video introduction, watch 3Blue1Brown's Transformers, the tech behind LLMs and Attention in transformers.
About this page. The tokenizer here is a small teaching model trained on English text. Production tokenizers have much larger vocabularies and cut text differently. Every provider sets its own rates. The dollar figures use one example rate so that the activities stay easy to compare: $5 per million input tokens and $25 per million output tokens. Many providers also discount repeated text at the start of a prompt through prompt caching.