Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Tokens, Context and Sampling  ›  Lesson

Tokens — How Models Read and Bill

Tokens 12 minLanguage models read, limit and charge for text in tokens, small pieces of words, so every length and cost estimate starts by converting to tokens.

Tokens — How Models Read and Bill

The Pedal Point owner sees the first monthly bill for the assistant and asks, "Why is it priced per token? What even is a token?" It is the right question. Every limit you will hit and every cost you will pay is counted in tokens, so this is the unit to think in.

The rule

Models read, limit and bill in tokens, not words or characters.

Before a model sees your text, a tokenizer chops it into tokens: common pieces of text, each mapped to a number. Frequent words are often one token. Rare words split into several pieces:

"Your order has shipped"   →  Your | order | has | shipped
"Trekkaroo saddle"         →  Tre | kk | aroo | saddle

(The exact split depends on the model's tokenizer; this one is illustrative.)

Three things follow:

  • Length. A model's limit on how much it can read and write is set in tokens.
  • Cost. Hosted models usually charge per token, often at different rates for input tokens (what you send) and output tokens (what it writes).
  • Speed. Output is produced one token at a time, so long answers take longer.

A common rule of thumb for English prose: one token is about four characters, or three-quarters of a word. So 100 words is roughly 130 tokens. Treat it as an estimate. Code, numbers, unusual names, and many languages other than English can take noticeably more tokens for the same meaning. When precision matters, run the model's own tokenizer and count.

The shortcut

To estimate tokens from English words, multiply by 4, divide by 3. Then add input and output together.

Pricing one returns questionStep 1 of 4
  1. Count the input words

    Instructions 150 + one policy chunk 300 + question 30 = 480 words.

The trap is forgetting the parts you do not see. Instructions and retrieved chunks are resent on every request, so they often cost more than the customer's short question. Trimming a bloated system prompt by a few hundred tokens saves money on every request the app ever makes, which is why engineers measure it.

Drills

Answer fast — trust the rule.

quick drill

Roughly how many tokens is 900 words of English prose?

quick drill

Why might a rare product name like "Trekkaroo" use several tokens?

quick drill

Which parts of a request typically count toward token usage?

quick drill

A teammate says "we can skip counting, 1 word is 1 token". What is the best reply?

Remember

  • Models read, limit and bill in tokens, not words or characters.
  • Words × 4 ÷ 3 ≈ tokens, for English prose.
  • Hidden parts, like instructions and retrieved text, are paid for on every request.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainEstimate one request

A Pedal Point request contains a 150-word set of instructions, three help-page chunks of about 300 words each, and a 30-word customer question, and the reply is about 120 words. Estimate the total tokens using the rule of thumb from this lesson, show your working, and name one reason the real count could be higher.