AI & LLM cost
Token
The basic unit of text that an LLM API meters and bills by. It is roughly three to four characters of English text, not a whole word.
Last updated
Definition
Language models do not process raw characters or whole words. They process tokens, which are sub-word chunks that the model's tokenizer produces. Pricing, context-window limits, and usage reports all use tokens. So the same sentence can cost different amounts depending on language, formatting, or how much of it is code and how much is prose. Tokenizers split these differently.
You cannot easily guess token counts from character or word counts. Teams that want to predict cost accurately measure real token counts on representative prompts. They do not estimate from text length.
Where it shows up
Token counts appear in a model provider's API response, in a usage field. The field reports the input and output token counts for that request. They also appear in the provider's console or usage dashboard. Every published rate card is built on the token as its metering unit.
What makes it expensive
Estimating cost from character counts or word counts feels close enough. It is not. A tokenizer splits prose, code, and other languages at different rates, so two texts of equal length can bill very differently. The API already returns a token count on every call. Measure a few representative prompts. Do not reason about them.
Related
Token spend moves every day.
Model prices and rate limits change between invoices. CostMon tracks your AI spend daily, so a change shows up before the bill does.