Paying by the Token
Leila's company has given her an API account, so she pays for the AI she uses by the amount, not a flat monthly fee. After a week she looks at the bill. One long conversation cost far more than all her short ones put together, though it wasn't that long. Where did the tokens go?
Input and output
AI companies charge for tokens, in two kinds:
- Input tokens: everything sent to the model in a request. Your message, and as you'll see, a lot more besides.
- Output tokens: everything the model writes back, including its thinking tokens, even the ones you never see.
Prices are given per million tokens, and output costs more than input, about five times as much for Claude's models. That's because reading text in is quick work for a model, while every output token needs its own full step.
To give a sense of scale, in late 2026 Claude's largest everyday model cost about 4 dollars per million input tokens and 20 dollars per million output tokens. Its smallest model cost about 40 times less. A million tokens is roughly 750,000 words, so a single question and answer costs a fraction of a cent. The interesting question is how a bill gets big.
Leila That's the strange part. My long chat had twenty messages from me. Each of my messages and its reply came to about 500 tokens. So 20 times 500 is 10,000 tokens. That should cost almost nothing.
Omid How does the model know what you said in your first message, by the time you send your twentieth?
Leila It remembers?
Omid We'll spend a whole lesson on that soon. For now, here's the short answer: the model keeps nothing between requests. To let it "remember", the app sends the whole conversation so far with every new message.
Leila Every time? So my second message sends the first one too?
Omid And your twentieth sends all nineteen before it. Try adding it up.
Leila The first request is about 500 tokens. The second, 1,000. The third, 1,500... up to 10,000 for the twentieth.
Omid And the total?
Leila 500 plus 1,000 plus 1,500, all the way to 10,000... that's 105,000 tokens. More than ten times what the conversation looks like!
Omid That's where your tokens went.
The growing staircase
Every new message carries the whole history with it, so the input grows with each turn, like a staircase. The total you pay for is the area of the whole staircase, not just the top step.
Now think of an agent. Every time it uses a tool, the result goes back into the conversation and the whole thing is sent again. A single task can take a hundred such steps, with tens of thousands of tokens of files and results in the conversation. That can add up to millions of input tokens for one job. The lesson The Same Start Every Time, near the end of the course, shows the trick that makes this much cheaper. Even with it, long sessions cost the most.
Time is tokens too
Speed works the same way. Reading input is fast, but output is written one token at a time, typically somewhere between tens and a couple of hundred tokens a second, depending on the model. A model that thinks for 5,000 tokens before answering makes you wait for every one of them.
If you use a subscription instead of paying per token, the same thing applies in a different form: subscriptions come with usage limits, and those limits are reached by the same long sessions and big contexts that would make a per-token bill grow.
Try it
Most AI companies have a public pricing page. Look up the price per million input and output tokens for two models from the same company, the biggest and the smallest. Then work out roughly what your last long chat cost: count the messages, guess the tokens per message, and add up the staircase.
Using it well
- Start a new conversation for a new task. Carrying an old, long conversation into an unrelated question makes every new message pay for all the old ones.
- Use a smaller model for simple, high-volume jobs. Sorting, formatting and short summaries rarely need the largest model, and a small one can cost dozens of times less.
- Keep big pastes out of long chats. A 20-page document pasted at message 3 is sent again with every message after it. Ask what you need from it in a fresh, short conversation.
- Watch thinking on easy tasks. Thinking tokens are output tokens, the expensive kind. Lower the effort when the job is simple.
Words to know
- input tokens - all the tokens sent to the model in a request, including the earlier conversation the app sends again
- output tokens - all the tokens the model writes in reply, including its thinking; priced higher than input
- price per million tokens - how AI use is priced: so many dollars per million input tokens, and more per million output tokens
Big idea
You pay for every token in and every token out, and output costs more. Because every message sends the whole conversation again, a long chat or agent session costs far more than its length suggests: you pay for the whole staircase, not the top step.