ToolNavs Find Useful AI Tools
Submit Sign in
Back to AI Encyclopedia
What Is a Token? LLMs Bill by It — Understand It Before Trying to Save

What Is a Token? LLMs Bill by It — Understand It Before Trying to Save

AI Encyclopedia • Admin • • 16 views

A token is the smallest unit in which a large language model reads and writes text, and it is also the unit for API pay-as-you-go billing. A model does not read Chinese characters or words directly; it only recognizes strings of numeric IDs: input text is first split into tokens by a tokenizer, converted into IDs and fed to the model, and output IDs are converted back into text. According to OpenAI, in English one token is about four characters, roughly three-quarters of a word, and 100 tokens are about 75 English words. Once you understand this unit, discussions about context length and bills finally share a common yardstick.

How tokens are produced

Tokenizers use statistical methods such as byte-pair encoding: common words take a single token, rare or long words are split into several, and punctuation, spaces and digits can each become a token of their own. OpenAI has open-sourced its own tokenizer, tiktoken, so you can count the tokens in any passage yourself. Note that different models use different tokenizers, so the same sentence can have different token counts on different models. In Chinese, a common character usually takes about one to two tokens, while code, URLs and long runs of digits tend to split more finely, so a Chinese passage and an English passage of the same length do not cost the same.

A token is neither a character nor a word

Bills usually list three kinds. Input tokens are everything you send: your question, pasted documents, conversation history and system instructions. Output tokens are the text the model writes back, and they usually cost more than input. Reasoning tokens are used internally by reasoning models while they think; they never appear in the answer, but they are billed at output rates. Prices are generally quoted per million tokens, with input and output priced separately. The context window is also measured in tokens: a window of one million tokens does not mean room for a million words. History, tool results and other content all take up space, and once the window is full, content must be cut or compressed.

A few common misunderstandings

First, fewer words does not mean cheaper: code and numbers are token-dense, and an error log can contain far more tokens than prose of the same length. Second, a lower unit price does not mean a lower total: a reasoning model may charge less per token, but it thinks at length before answering, and those reasoning tokens can push the total above a pricier model. Third, people treat the context window as a warehouse and stuff everything into it, but the larger the window, the more input tokens each request carries and the faster the bill grows; trimming long conversations regularly is the honest way to save.

The ways to save are simple: state your requirements clearly before asking, so the model does not write a long draft you then ask it to redo; summarize long documents before pasting them instead of throwing in the whole text; use caching for instructions you repeat; and switch to a smaller model for simple tasks. Chat products on a monthly subscription do not require you to count tokens at all, since the bill is monthly. Only when you pay per use through an API does a token translate directly into money. Understand it first, and only then talk about saving, so a low unit price cannot mislead you.

Recommended Tools

More