Skip to content

Inference 101, lesson 3

Why long chats cost more

The model forgets you between messages, so every turn sends the whole chat again. This lesson shows what that costs, why long chats fill the chip's memory, and how a repeated start can be charged less.

What do you run?

Every example below changes to fit what you pick. The businesses are made up for teaching.

The picture, one step at a time

Each box is one stage. The picture lights up as you scroll.

Step 1 of 6

It does not remember you

Each turn of a chat is a brand-new request. To answer your twentieth message, the app sends all twenty messages and every reply so far. The model reads the lot again. And you pay for all of it as input, every turn.

Even where a provider stores the chat for you, OpenAI's guide says "all previous input tokens for responses in the chain are billed as input tokens" (read 28 November 2026).

Turn 20 of a chat. What do you pay for as input?

Step 2 of 6

So the bill grows every turn

Take made-up round numbers: each turn adds 500 tokens to what is sent. Turn 1 sends 500. Turn 10 sends 5,000. Over ten turns you send 27,500 input tokens, more than five times what ten fresh one-off questions would send.

Step 3 of 6

Its working memory: the KV cache

While the model reads, it writes notes on every token so it can write the next one without starting from scratch. These notes are called the KV cache. They grow with every token in the chat, and they sit in the chip's memory, right beside the model.

The vLLM paper (Kwon and others, 2023) works an example: for one 13-billion-parameter model, the notes for a single token take 800 KB, and for one 2,048-token request as much as 1.6 GB.

Step 4 of 6

Long context costs memory, and memory costs money

A chip's memory is fixed. A long chat's notes crowd out other users, so fewer people share each read of the model (lesson 2). Fewer users sharing means more cost per token. That is why long context is the dearest thing to serve.

Some price lists show it directly: a few models charge more per token once a prompt gets very long.

Step 5 of 6

A cached start is cheaper

Many prompts start the same way: the same instructions, the same documents. If yours matches a recent one, some providers keep the notes for that start and charge much less to reuse them. This is prompt caching. It only works if the repeated part comes first and stays exactly the same.

Anthropic charges a tenth of the normal input price, or less on some models, to read a cached start, and a quarter more than normal to store it for five minutes. OpenAI also lists a cheaper "cached input" price for each model (both read 28 November 2026).

Which prompt gains most from caching?

Step 6 of 6

What this means for you

When you use AI for answering customers, three habits keep long chats in check. Put what never changes first, so it can be cached. Start a fresh chat with a short summary when the old one gets long. And send only what the next answer needs.

Why did that cost more, or less?

Here are four things that happen in long chats in your business. Sort each one into the part of the picture that explains it.

  1. 1A customer's chat runs to 40 messages. The fortieth reply is one line, and costs far more than the first.

  2. 2Your own rented chip can hold dozens of short chats at once, but only a handful of very long ones.

  3. 3Every chat starts with the same long returns policy, and that part of the bill comes in at a fraction of the normal price.

  4. 4Pasting the customer's whole order history into each message makes every later turn dearer.

0 of 4 right so far, 4 to go.

The context-length card

This is what you keep: why length costs money, on one card, and the habit that keeps it down.

The context-length card

  1. Every turn sends the whole chat again, and you pay for it again as input.
  2. Ten turns can cost several times as much as ten separate questions.
  3. The model keeps notes on everything it reads (the KV cache). They grow with the chat and fill the chip's memory.
  4. Long chats leave room for fewer users, which is why long context costs more to serve.
  5. A repeated start can be cached and charged at a fraction of the input price.

Put what never changes first, start fresh when a chat gets long, and send only what the next answer needs.

Next: Lesson 4: price per task, not per token. How to cost a finished job, hidden thinking and retries included.