Back to blog

AI for beginnersGuide

What is a token in AI? A plain-English explanation

A token is the piece of text an AI model reads and writes. See how a real tokenizer splits a sentence, how many tokens a word takes and how tokens become a bill.

By CheapTokens TeamPublished Updated 4 min read

A sentence split into colored token blocks with a token counter
On this page
  1. How a model cuts text into tokens
  2. How many tokens is a word
  3. Tokens are what you pay for
  4. Four things people call a "token"
  5. Why you might see "not enough tokens"
  6. How to count tokens in your own text
  7. Your next step

A token is a small piece of text that a language model works with: a whole word, part of a word, a punctuation mark, or a word together with the space in front of it. Models read your prompt as tokens, write the answer as tokens, and AI APIs bill by the token. So "how many tokens is this" is really two questions: will it fit, and what will it cost.

Animation: the sentence “Tokenization splits text into pieces the model counts” breaks into 9 tokens, one by one
How a model sees a sentence: token by token

How a model cuts text into tokens#

Before a model sees your text, a tokenizer splits it into pieces from a fixed vocabulary and turns each piece into a number. Frequent words usually get a single token. Rare and long words are split into parts.

Here is a real example. We ran one sentence through two tokenizers: the one published with DeepSeek-V4-Flash-0731 and OpenAI's o200k_base encoding.

The sentence "A neural network reads text in tokens, not words." split into 11 tokens by the DeepSeek-V4-Flash and OpenAI tokenizers
Real tokenizer output, October 20, 2026: tokenizers 0.22.2 with the DeepSeek-V4-Flash-0731 tokenizer, tiktoken 0.12.0 with o200k_base

In English both tokenizers agree: 9 words, 11 tokens. The comma and the period are tokens of their own, and most words carry the space before them.

Long words are where tokenizers start to differ. "tokenization" is two tokens in both: token + ization. The Russian word «токенизация» is three tokens for DeepSeek and four for OpenAI. Same word, different count.

How many tokens is a word#

A quick test with a short paragraph about tokens, in English and in Russian:

Text Words DeepSeek-V4-Flash OpenAI o200k_base
English paragraph, 254 characters 53 60 tokens 60 tokens
The same paragraph in Russian, 255 characters 42 73 tokens 65 tokens

For English text, about 1.1–1.2 tokens per word is a fair estimate. Other scripts usually cost more: the Russian version says the same thing in fewer words but takes about 20% more tokens with DeepSeek's tokenizer.

Treat these as rules of thumb. Every model family has its own tokenizer, and the exact count for your text is the one the API reports back.

Tokens are what you pay for#

API prices are quoted per million tokens, separately for input and output:

  • input tokens — everything you send: the system prompt, chat history, documents and your question;
  • output tokens — everything the model writes back, including its reasoning if the model reasons before answering.

The cost of a request is input tokens × input price + output tokens × output price.

Two practical consequences. A long chat gets more expensive with every message, because the whole history goes back to the model as input each time. And output usually costs several times more per token than input, so asking for shorter answers saves real money.

Four things people call a "token"#

The word is overloaded, which is why searching for it is so confusing:

Where you saw it What it means
A model's limits or prices Pieces of text, as described above
"API token", "access token" A secret key that lets your code call the API. It identifies you; it is not a prepaid amount of text
Tokens inside a chat app Often the app's own credits. How they relate to model tokens is up to the app
Crypto tokens A blockchain asset, unrelated to language models

If you're answering a quiz question like "a token is…", for language models the right answer is a piece of text: a word, part of a word or a symbol.

Why you might see "not enough tokens"#

The same phrase can point to four different problems, and only one of them is about money:

  • The prompt doesn't fit into the context window. Every model has a limit on input plus output. At CheapTokens it's 380,000 tokens for DeepSeek-V4-Flash, 390,000 for GLM-5.3-Flash and 200,000 for MiniMax-M2.7. Shorten the history or split the document.
  • The answer hit the output limit. The reply stops mid-sentence. Raise max_tokens within the model's maximum, or ask for a shorter answer.
  • The balance ran out. This is the only case where topping up fixes it.
  • The app has its own limit. Chat services often cap usage by their own rules, unrelated to the model itself.

How to count tokens in your own text#

The most reliable number comes from the API: every response includes a usage block with prompt_tokens and completion_tokens.

To estimate before sending, run the model's tokenizer locally. Open models publish their tokenizer next to the weights. This snippet counts the example sentence with the DeepSeek-V4-Flash-0731 tokenizer:

python
# pip install tokenizers huggingface_hub
from huggingface_hub import hf_hub_download
from tokenizers import Tokenizer

path = hf_hub_download("deepseek-ai/DeepSeek-V4-Flash-0731", "tokenizer.json")
tok = Tokenizer.from_file(path)

text = "A neural network reads text in tokens, not words."
enc = tok.encode(text, add_special_tokens=False)
print(len(enc.ids))  # 11

For OpenAI models there's the tiktoken library. Keep in mind that a count from one tokenizer is only an estimate for any other model.

Your next step#

To estimate a budget, take a typical prompt and answer size and multiply by the price per million tokens. Current CheapTokens prices, fixed in US dollars:

Model Context Input $/1M Output $/1M OpenRouter in OpenRouter out
GLM-5.3-Flash reasoning 390K $0.027 $0.08 $0.048 $0.20
DeepSeek-V4-Flash 380K $0.0221 $0.10 $0.016 $0.64
MiniMax-M2.7 200K $0.05 $0.15 $0.30 $1.20

Prices in USD per 1M tokens. OpenRouter figures shown for comparison and may change.