Skip to content

What is a token in AI? Tokens, words and API cost explained

What a token is, how many words it holds in English and Arabic, and how tokens set the cost of every AI API request, with a worked example.

Updated November 1, 2026Markdown version

A token is a piece of text that an AI model reads and writes: a word, part of a word, a number or a punctuation mark. AI APIs count the tokens you send and the tokens the model writes, and bill per million. In English a token is about four characters; Arabic text needs more tokens per word.

What is a token?#

A model never sees letters or whole sentences. Before your text reaches it, a tokenizer cuts the text into pieces from a fixed vocabulary and gives each piece a number. The model works on those numbers and writes its answer back one token at a time.

OpenAI's docs put it this way: models "process text in chunks called tokens", and tokens "represent commonly occurring sequences of characters". Anthropic's glossary calls tokens the smallest units of a language model, which can be words, parts of words, characters or bytes.

A few patterns hold across tokenizers:

  • Common words are often one token, rare words split. In our test with OpenAI's open tokenizer, token is one token and tokenization is two: token and ization.
  • Spaces, punctuation and digits count too. Long numbers, links and code often split into many small tokens.
  • Each provider has its own tokenizer. The same text gives a different count on Claude, GPT and Gemini models.

How many words is a token?#

Providers publish rules of thumb for English text:

ProviderRule of thumb for English
OpenAIAbout 4 characters, or 0.75 words, per token
Google (Gemini)About 4 characters per token; 100 tokens is about 60 to 80 words
Anthropic (Claude)About 3.5 characters per token on earlier models; newer models produce about 30% more tokens for the same text

So 1,000 English words come to about 1,330 tokens by OpenAI's rule, or between 1,250 and 1,670 by Google's. These are averages for plain prose; code, links and other languages change the ratio, and only the count the API returns is exact.

Does Arabic use more tokens than English?#

Usually, yes. A tokenizer learns its pieces from training text, and when most of that text is English, English words get whole pieces while words in other languages are split into more parts. A 2023 study by Petrov and colleagues found that the same text translated into different languages can differ in token count by up to 15 times.

We ran one English sentence and its Arabic translation through the same tokenizer (OpenAI's o200k_base, on 2026-11-01):

SentenceWordsCharactersTokens
English: a support bot that answers order questions2616231
The same sentence in Arabic2212237

The Arabic sentence is shorter in words and characters, yet it needs about 19% more tokens: about 1.7 tokens per word against 1.2 in English. That is one sentence on one tokenizer, so treat it as an illustration, not a rate. To know your own ratio, send a sample of your real text and read the count in the reply.

How do tokens set the price?#

APIs price models per million tokens, with one price for input (what you send) and another for output (what the model writes). Output usually costs several times more than input. The cost of a request is:

Request cost
cost = input tokens ÷ 1,000,000 × input price
     + output tokens ÷ 1,000,000 × output price

The default model's price per million tokens, ours next to the official one:

Claude Sonnet 5.5 price per 1M tokens
Input$0.60Official price: $2
Output$3Official price: $10

Official price from the provider's page, checked October 19, 2026.

As a worked example, take a support bot that answers 1,000 questions a month. Each request sends about 1,500 tokens (the store's policy, the question and some history) and gets back about 300. That is 1.5 million input tokens and 300,000 output tokens a month:

Example: what Claude Sonnet 5.5 costs

1.5M input tokens and 300K output tokens

Our price$1.8070% below the official price
Official price$6.00

Official price from the provider's page, checked October 19, 2026.

Output is a fifth of the input here, yet a large share of the bill, because each output token costs more. And since the policy text goes out with every request, shortening it cuts the input cost of all 1,000 requests.

What counts as tokens in a request?#

The question you type is often the smallest part of what you pay for:

  • Conversation history. Chat formats resend the earlier messages with each new turn, so a long conversation costs more on every reply.
  • System prompt and tool definitions. Instructions and tool schemas go with every request, billed as input each time.
  • Images and audio. These become tokens too. In Google's Gemini docs, an image up to 384 pixels on each side counts as 258 tokens, and audio 32 tokens per second.
  • Reasoning tokens. Reasoning models think before they answer. OpenAI says that while reasoning tokens are not visible through the API, they "still occupy space in the model's context window and are billed as output tokens". Anthropic reports them for Claude in usage.output_tokens_details.thinking_tokens.
  • Cached input. When many requests start with the same long text, the provider can read it from a cache at a lower price; see Prompt caching.

What is a context window?#

The context window is the most tokens a model can handle in one request. Anthropic describes it as the model's working memory. OpenAI's rule is that the prompt and the generated output together must fit within the model's maximum context length.

A larger window fits longer documents and conversations, but every token you put in it is billed. On 5abeer, a request longer than the model's window answers 400 with CONTEXT_LIMIT_EXCEEDED, and Context length lists the window of each model.

How do you count tokens?#

Every reply reports the tokens it was billed for. The field names depend on the format:

FormatInputOutput
OpenAI Chat Completionsusage.prompt_tokensusage.completion_tokens
OpenAI Responsesusage.input_tokensusage.output_tokens
Anthropic Messagesusage.input_tokensusage.output_tokens
GeminiusageMetadata.promptTokenCountusageMetadata.candidatesTokenCount

To count before you send, the Messages format has a count tokens request that returns input_tokens without calling the model. Anthropic calls that count an estimate, and when counting isn't available for a model you get 404.

After you send, your dashboard shows usage and cost per key and per model, as in Track your usage.

How to use fewer tokens#

  • Keep the system prompt short and stable. You pay for it on every request.
  • Send only what the model needs. The relevant part of a document, not the whole file.
  • Trim long conversations. Drop or summarize older turns.
  • Put fixed text first. A stable start lets the cache work. With Claude models, mark it with cache_control in Messages.
  • Cap the answer. Set max_tokens in Messages, max_completion_tokens in Chat Completions or max_output_tokens in Responses. On 5abeer, Gemini models aren't served on Responses, and GPT models ignore these caps, so with GPT also ask for a short answer in the prompt.
  • Match the model to the task. A smaller model is often enough for sorting, tagging or short replies.

How 5abeer bills tokens#

A 5abeer API key pays per token from your balance, with input and output priced apart. Every model priced per token costs less than its official price. Our prices follow the published official prices, and every price shows the date it was last checked. Compare each model on the API page and the models page, or see the Claude models on Claude API.

Each key can have a spend limit, an expiry date and an IP allow-list, so a script stuck in a loop can't spend more than you set. The steps are in Control every key.

Subscription plans work differently: a fixed price with a 5-hour limit and a weekly limit, shown on the pricing page. Plans are for the supported apps; to use the models from your own code, create an API key. With Continue from the wallet on, requests after a plan limit are charged to your balance until the limit resets. Compare the two in AI subscription vs API and, for Claude, in Claude API vs Claude Pro/Max. New to keys? Start with How to get an API key.

FAQ#

Is a token the same as a word?#

No. In English a token is about three quarters of a word on average, so 100 tokens hold about 60 to 80 words. Short common words are often one token, and long or rare words split into several.

Are output tokens billed too?#

Yes, and usually at a higher price than input. A long answer adds more to the bill than a long question of the same length. Each model's input and output prices are on the API page.

Are reasoning tokens billed?#

Yes. OpenAI and Anthropic both bill a model's reasoning as output tokens, even when you don't see the reasoning text.

Do all models count the same text the same way?#

No. Each provider uses its own tokenizer, and a newer model can count the same text differently from an older one. To compare, send the same sample to each model.

How many tokens is one page?#

A page of about 500 English words comes to roughly 600 to 850 tokens by the rules above. Arabic text, code and tables usually need more.

Do subscription plans count tokens?#

Plans have a fixed price with a 5-hour limit and a weekly limit, rather than a per-token bill. An API key is billed per token from your balance. Both are on the pricing page.

Where do I see how many tokens I used?#

In the usage numbers of each reply, and in your dashboard, per key and per model.

Sources#

Checked on 2026-11-01:

Get started#

Compare per-model prices on the API page, or create a key and see the token counts in your first reply.