Home / Costs & subscriptions / What one call costs: three variables in the token ledger
What one call costs: three variables in the token ledger
Input, output, and cache hits — three variables decide the real cost of a single request. The formula worked through with concrete numbers.
A subscription hides the cost; pay-as-you-go lays it out in the open. But to use pay-as-you-go you first have to know how to do the arithmetic, otherwise it's easy to reach the wrong conclusion that it's "more expensive than a subscription" or "cheaper than a subscription."
The formula itself is simple
Cost per request ≈ input tokens × input unit price + output tokens × output unit price
The trouble is in the three variables: the input isn't as small as you think, the output isn't something you can predict, and cache hits change the unit price.
Variable one: input gets amplified
Many people estimate input based on "I sent a 500-word piece of code." What a request with a file read actually consists of is this:
- System prompt and tool definitions: a few hundred to two thousand tokens
- Conversation history: accumulating with every turn
- The contents of the files being read in: several thousand to tens of thousands
- Your actual question: tens to hundreds
So the input tokens are usually more than ten times the question itself. In a ten-turn conversation, history alone can pile up to tens of thousands of tokens.
Variable two: output doesn't get that long
The output side is actually easier to estimate: a single answer is usually 300–1500 tokens, and can reach 3000 when writing code. The output unit price is generally 2–5× the input price, but because the volume is small, the absolute amount often isn't higher than input.
What's really expensive is repeated revision: have the model rework a task three times and the output triples, while each round has to carry the full context again.
Variable three: cache hits
The major vendors all give a discount on "repeated input with the same prefix," typically landing between half and 90% of the full rate. The implication is direct: asking questions back-to-back within the same conversation is far cheaper than starting a new session each time.
This also explains a counterintuitive phenomenon: reading a long document in once and then asking ten questions in that same session is an order of magnitude cheaper than reading it once per question, ten times over.
A set of concrete numbers
Assume unit prices of $3 per million input tokens and $15 per million output tokens (for illustration only, not current pricing):
| Scenario | Input | Output | Cost |
|---|---|---|---|
| Single-turn Q&A | 4k | 500 | $0.0195 |
| Read a repo, change one spot | 40k | 2k | $0.15 |
| Ten rounds of iterative refactoring | 300k cumulative | 20k | $1.2 |
Going by the third row, doing five tasks like that in a day is about $6; over 20 working days a month that's $120. That number already exceeds the price of most subscriptions.
How to use the conclusion
- Light, sporadic, unpredictable frequency → pay-as-you-go fits better.
- Steady high intensity every day → a subscription is almost always cheaper, because the subscription has a fixed ceiling.
- Reading the same batch of files over and over → make use of the cache: put the files at the start of the session and read them once.
One last reminder: price tables can change every quarter, so the numbers above only demonstrate the arithmetic. Before you actually commit, record your own input and output volumes for a week, then plug them into the formula.
Monthly review template
| Item | Last month | This month | Reason for change |
|---|---|---|---|
| Input tokens | Did the context get longer | ||
| Output tokens | Did the answers get wordier | ||
| Cache hits | Are the prompts stable | ||
| Cost per request | Changed model / changed parameters |
Fill in four rows and it's obvious where the money goes. Without this table, "cutting costs" just means cutting features by feel.
One more note: track "cache hit rate" as its own line. When prompts are stable the hit rate is high and costs drop sharply; the moment you keep changing the system prompt, the hit rate goes to zero and the bill changes before you feel it.