Token
A token is the unit of text a language model reads and writes — roughly four characters of English, or about three quarters of a word — and it is also the unit that every language model API bills by.
Models do not operate on characters or words. A tokeniser splits text into subword pieces drawn from a fixed vocabulary, so a common word is usually one token, an unusual word is two or three, and a rare proper noun may be five or six. The model then works entirely in that alphabet: it reads a sequence of tokens and predicts the next one.
The practical consequence is that token count is not proportional to anything a human counts. Code tokenises less efficiently than prose because punctuation and indentation are frequent boundaries. Languages that do not use Latin script tokenise far less efficiently again, sometimes at one token per character, which means the same meaning in two languages can differ several-fold in tokens.
Every tokeniser is model-specific. Two models given identical text will report different token counts, so a count measured against one model's tokeniser is an estimate against another's, not a figure to budget from. The only authoritative count is the one the API returns in the response.
That is why our responses carry the exact charge alongside the token counts rather than leaving you to multiply. A count you have to reconcile against a rate card is a count you will eventually reconcile wrongly.
What it costs you
Tokens are the billing unit, so anything that changes how text tokenises changes the bill without changing the work. A verbose system prompt, a JSON schema repeated in full on every call, or a corpus in a language that tokenises poorly all raise cost with no effect on output quality. Counting tokens rather than characters is the first honest estimate of what an application will cost, and it is usually a larger number than the author expected.
Worked from today’s rates
A million tokens is roughly 750,000 words of English. Sending that much text to DeepSeek V4 Flash as input costs $0.090/M, against DeepSeek's official $0.14/M.
Related terms
- Input vs output tokensInput tokens are the text you send a model and output tokens are the text it writes back; they are billed at separate rates, and the output rate is almost always several times the input rate.
- Context windowA context window is the maximum number of tokens a model can hold in one request, counting the system prompt, the conversation history, any retrieved documents and the reply being generated together.
- EmbeddingAn embedding is a fixed-length list of numbers representing a piece of text, produced by a model so that texts with similar meaning land close together in that vector space, which is what makes semantic search and retrieval possible.
Go deeper
Every rate quoted above is published in full on the pricing page, alongside the model publisher’s own official rate.