Skip to content
0%
0% of stage
Concept 2 min

Token

The piece of text the model counts. It is the billing unit and what fills the context window, but never your unit of outcome.

In one sentence

The unit the model uses to measure everything: pieces of words it counts in the input and output. Billing is by token, and the context window fills up in tokens.

Before

Full text

What it does

Broken into countable pieces

After

Billed and added to the window

each call starts the count over

Analogy

It is the penny on the electricity bill. Nobody turns on a lamp thinking in kilowatt-hours; they turn it on to see. But the bill comes in kWh, and anyone who wants to save money needs to know the conversion between one thing and the other.

Example

"relationship letter" does not become three tokens, one per word: in Portuguese, a common word usually becomes two or three tokens, and a proper name or rare term breaks into even more pieces.

That has a practical consequence: an agent that rereads the entire field report for each letter spends the same reading tokens every time. A thousand letters later, you have paid a thousand times for the same document, and none of those readings improved the translation.

The common mistake

Optimizing tokens and thinking you optimized cost. Token is the model's unit of measurement; yours is the outcome. A lean prompt that gets it wrong and needs three tries costs more than a bulky prompt that gets it right the first time.

If you do not know how much a translated letter costs, knowing how much a thousand tokens cost is useless for deciding anything. See Agent Unit Economics.

In practice

  • Measure cost per outcome, and use tokens only to investigate why the cost

per outcome went up.

  • Look at input and output separately. The surprise is almost always in one of the two.
  • If the same document goes into every call, it is a candidate for cache: you pay

once instead of a thousand times.

  • Ask for short output when the output is only a decision. If a label solves it, do not

ask for text.

How to make it tangible

One line in the log for each execution with input tokens, output tokens, and the cost of that call. Without that, discussing cost is guesswork.

Note

Input and output cost different amounts, and output usually costs much more. This changes the design: asking the model for a short summary of a long text is cheap; asking it to rewrite the entire long text is not.

It is also worth knowing that the same text yields more tokens in Portuguese than in English, because models were trained on more English, and the vocabulary reflects that. An operation that runs in Portuguese pays a little more for the same thing.

Translated from Portuguese with AI assistance.

To discuss

Is this already in place in your company? Compare with the criterion:

Done when: You can answer "how much did the last outcome cost" without opening the vendor's invoice.