# Token

> A token is the small unit of text, often a word or part of a word, that a language model reads and writes, and the unit that most AI providers use to measure and bill usage.

Also called: tokens, tokenisation, tokenization, token count. Category: Models and training. Source: https://aibuildindex.com/glossary/token

## In the index

- AI API integration: median $2,500, middle half $500 to $6,400, 1,993 priced briefs (https://aibuildindex.com/cost/ai-api-integration)
- OpenAI: median $2,000, middle half $400 to $6,800, 3,445 priced briefs (https://aibuildindex.com/tools/openai)

Language models do not read letters or whole words. They read tokens: chunks of text produced by a tokeniser, where a common English word may be one token and a rare word, a number or a word in another language may be split into several. Tokens matter to a business buyer for one practical reason: they are the meter. Model limits are set in tokens, speed is measured in tokens per second, and hosted model usage is billed per token.

## How it works

Before a model sees any text, a tokeniser splits it into pieces drawn from a fixed vocabulary and turns each piece into a number. The model works entirely on these numbers and produces its reply one token at a time, which the tokeniser turns back into text.

A few consequences follow:

- **Length is counted in tokens, not words.** In English, a token is often a little shorter than a word on average, but code, tables, unusual names and many non-English languages use more tokens for the same meaning.
- **Input and output are counted separately.** The tokens you send (instructions, documents, conversation history) and the tokens the model writes back are usually tracked, and often priced, differently.
- **Every model family has its own tokeniser.** The same text can produce different counts on different providers.

Take a support assistant that answers a short question by sending the model a page of rules, five retrieved help articles and the chat history. The question is a handful of tokens; everything around it may be thousands, and that context is sent again with every message.

## What it means for cost

Tokens connect design choices to running costs. Anything that adds text to each request, such as long system instructions, whole documents instead of relevant passages, or full chat histories, raises the token count and so the bill, and also makes responses slower. That is why [token pricing](https://aibuildindex.com/glossary/token-pricing), [context window](https://aibuildindex.com/glossary/context-window) size and techniques such as [prompt caching](https://aibuildindex.com/glossary/prompt-caching) come up in any serious estimate.

Good builders measure token use on realistic traffic before launch rather than guessing. Ask for an estimate of tokens per task, what drives it, and what the build does to keep it down, for example trimming history, retrieving fewer passages or routing simple tasks to a cheaper model.

## Common questions

### How many words are in a token?

There is no fixed ratio. For ordinary English prose a token is usually somewhat less than a word, but the count varies with the language, the vocabulary and the tokeniser. Providers publish tools for counting tokens exactly.

### Why does a non-English build use more tokens?

Tokenisers are built from training data that is often weighted towards English, so English words are more often single tokens. Other languages, especially those with different scripts, may be split into more pieces, which raises usage for the same content.

### Do images and audio use tokens too?

With [multimodal models](https://aibuildindex.com/glossary/multimodal-model), yes. Images and audio are converted into tokens or token equivalents for billing and limits, and the count depends on resolution or duration as described in each provider's documentation.

## Related terms

- [Context window](https://aibuildindex.com/glossary/context-window): A context window is the maximum amount of text, measured in tokens, that a language model can take in and produce in a single request, including instructions, documents, conversation history and its own reply.
- [Token pricing](https://aibuildindex.com/glossary/token-pricing): Token pricing is the usage-based billing model most AI model providers use, charging per number of tokens sent to and generated by the model, usually with separate rates for input and output and different rates for each model.
- [Large language model (LLM)](https://aibuildindex.com/glossary/large-language-model): A large language model is an AI model trained on very large amounts of text to predict the next word, which lets it write, summarise, translate, classify and answer questions in natural language.
- [Prompt caching](https://aibuildindex.com/glossary/prompt-caching): Prompt caching is a provider feature that stores the processed form of a repeated opening section of a prompt, such as long instructions or a reference document, so later requests that reuse it are cheaper and faster.
- [Inference](https://aibuildindex.com/glossary/inference): Inference is the stage where a trained AI model is used to produce outputs, such as answers, classifications or images, from new inputs, as opposed to training, where the model learns from data.
