Tokens are a language model's processing units; the context window limits the working material of a request. That material includes instructions, supplied information and generated output. When a detail is missing or used incorrectly, this can look like “forgetting”.
This article explains how tokens and context windows relate, why a long chat may process the same material repeatedly, and how to assess costs alongside answer quality. Provider details and model examples were checked on 13 October 2026.
What are tokens and how are they counted?
A token is a unit a model uses to process content. For text, it can be a character, a word or part of a word. There is therefore no fixed conversion from words or pages into tokens.
A tokenizer is the method that splits text into these units. Language and model affect the result. OpenAI's explanation of token counting also describes punctuation and spaces as parts of this process. Punctuation and spaces can therefore contribute to usage too. Anthropic shows how much the tokenizer matters: according to its token counting documentation, the same text produces roughly 30 per cent more tokens on Claude models from Opus 4.7 onwards, because of a newer tokenizer, than on earlier models.
Google gives a rough Gemini estimate of about four characters per token and approximately 60 to 80 English words per 100 tokens. Its Gemini documentation also provides counting before a call and usage details afterwards. Do not treat that rule as an exact budget for German text or other models.
A specialist retailer wants to process the same product notice in German and English. It counts both versions with the selected model and records text, model version and result. Long German compound words are a reason to measure, rather than proof of a fixed surcharge.
Images and other media can also be converted into model-specific units. You therefore cannot budget for a scanned document solely from its visible words. For how an LLM, a large language model, works, read What is an LLM?.
What fits into a model's context window?
The context window limits which supplied content the model can consider during a request. It is distinct from training knowledge and must also leave room for output.
Picture a work desk: you put the necessary documents on it and need space for the answer being written. A larger desk offers more room. It does not establish whether the right document is read and correctly understood.
According to Anthropic's context documentation, system instructions, messages, tool definitions and results count towards context. The system instruction provides overarching rules. Tool definitions describe functions the application makes available to the model.
Specific sizes depend on the model. Claude Sonnet 5.5 has a one-million-token context window according to its provider. Claude Haiku 4.5, now listed as a legacy model, has 200,000 tokens. These examples do not describe every Claude plan or chat product.
Check maximum output and application limits as well. One million context tokens does not mean the model can write a million-token answer. File size, uploads and the portion available for user input can have their own limits. OpenAI explains on its business pricing page that other features use part of the shared context.
Why does AI seem to forget details?
A missing or incorrect answer can have several causes. Information may not have been supplied, may have been omitted from a summary, or may have been used incorrectly despite being in context. The answer alone cannot reliably establish the cause.
Anthropic describes compaction, a method that replaces older conversation turns with a summary. This keeps the active history shorter. When preparing your own summary, check that essential details survive.
Also, “fits inside” does not mean “used reliably”. The original Lost in the Middle study found disadvantages when important information appeared in the middle of long inputs for the tasks and models tested. This is a prompt for your testing, rather than an error rate for every current model.
A service office works on several quotations in a long chat. Later, a previously stated delivery condition is reproduced incorrectly. Repeat the case with a short, complete extract and a clear question. If the answer then becomes correct, you have a possible improvement; this proves neither deletion nor a fixed threshold after a particular number of messages.
The application matters too. Depending on settings, ChatGPT Memory can use earlier information for personalisation, but does not retain every detail. A new chat may also receive prepared instructions or project sources. It therefore does not reliably reset all stored information.
Distinguish current working material, saved memories and information the application retrieves separately. The model can also use training knowledge. For precise business details, still supply the authoritative source and check the answer.
How do token costs arise through an API?
An API, an application programming interface, can incur charges for input, output and other services, depending on the provider and model. A chat subscription has its own usage conditions and is not a universal token rate card.
The Anthropic pricing page lists standard Claude Sonnet 5.5 rates of $2 per million input tokens and $10 per million output tokens. We use this model solely to explain the calculation, not as a recommendation. Budget for other models using their own rates.
Example calculation for one month: a trades business processes 1,000 questions. Each question incurs 3,000 input tokens and 300 output tokens in total. Input already includes instructions, service information and the question. We assume no cache hits, extra model calls or tools.
| Component | Monthly volume | Standard rate per million | Cost |
|---|---|---|---|
| Input | 3 million tokens | $2 | $6 |
| Output | 0.3 million tokens | $10 | $3 |
| Total | Input plus output | $9 |
In words: three million input tokens cost six dollars. Three hundred thousand output tokens cost three dollars. Together that is nine dollars in standard token costs alone under these assumptions. A complete chatbot price includes further costs.
Output here means the complete billed output. For models with additional thinking, that can include reasoning tokens. OpenAI explains that these occupy context and are billed as output. If they are already included in the output total, do not add them a second time.
Search tools or other services can also have separate charges, as the OpenAI API rate card shows. Your overall budget additionally includes setup, hosting, operation and human review. How much does AI automation cost? puts these costs in context.
Why can long conversation histories incur repeated costs?
If an application supplies the previous history again with every call, the model processes the same material repeatedly. The length of the latest message alone then fails to describe consumption.
Consider an explicitly simplified sequence of twenty calls. The first contains 500 input tokens; each subsequent call contains 500 more. Earlier material is reused in full. For this partial calculation, we exclude extra fixed instructions and output tokens, with neither shortening nor caching.
| Call | Input in this call | Cumulative input |
|---|---|---|
| 1 | 500 tokens | 500 tokens |
| 2 | 1,000 tokens | 1,500 tokens |
| 10 | 5,000 tokens | 27,500 tokens |
| 20 | 10,000 tokens | 105,000 tokens |
The twentieth input is ten thousand tokens long. Across all twenty calls, however, one hundred and five thousand input tokens have been processed. Reuse explains the difference: existing text is read again. Actual billing can differ if the application shortens material or uses cheaper cache-read rates.
Prompt caching means retaining eligible, unchanged input for reuse. It changes billing, rather than the size of the context window. Anthropic documents separate write and read costs, plus conditions such as minimum length and cache lifetime. Repeated text is therefore not automatically a cheaper cache hit.
For a business, the practical question is which unchanged information is supplied at every step, and why. A compact task description can help. Keep every condition needed for a correct answer.
How do you save tokens without losing essential information?
Supply the smallest complete context for the task. Saving is useful when the answer remains correct, complete and easy to check.
A manufacturer wants to answer a maintenance question about a specific machine. It supplies the appropriate manual version, relevant chapter and model designation. A warning in a neighbouring section belongs too if it affects the maintenance work. A short extract that omits this warning would be a poor reduction.
Use these steps:
- Bound the task: name the desired result and required format.
- Select sources: supply relevant, approved documents with their versions.
- Save progress: record decisions, open questions and conditions in writing.
- Check summaries: compare important details with original sources before starting again with them.
- Limit output appropriately: ask for a brief list if you do not need a long report.
- Test a cheaper candidate: use the same tasks; do not assume equal quality beforehand.
You can ask several questions about a document together. This can reduce repeated input, but does not guarantee a lower total bill: a long answer or additional reasoning affects consumption too. Split tasks when important review steps would otherwise become difficult to follow.
For large knowledge collections, retrieval-augmented generation (RAG) can help by producing answers with selectively retrieved sources. Anthropic explains for projects how relevant passages are searched in uploaded documents. What is RAG? explains the approach further.
Retrieval can return the wrong passage or miss an important source. Check retrieval and the answer separately. A large context window also does not protect against false information; OpenAI describes this reliability limitation.
How do you measure consumption and answer quality at work?
Measure complete, repeatable tasks and assess results alongside costs. The smallest input alone is not evidence of quality.
For a custom integration, Anthropic offers token counting before a call. Compare the estimate with actual usage afterwards. If a chat interface does not show complete counters, at least record task, supplied material, settings and observed limits.
A simple measurement sheet contains model version, date, language, input, cache writes, cache reads, total output, tool charges and review time. Mark whether reported reasoning tokens are a component of output. Also record missing conditions, false statements and accepted results.
First compare the detailed request with a selectively shortened version. Both must contain the same task and all essential facts. Check difficult cases such as conflicting document versions and missing details. Only then decide whether the reduction is actually better.
- Selected model and actual product limits recorded
- Complete request counted, rather than just the latest message
- Essential facts and document versions preserved
- Summary checked against original sources
- Cache conditions and output billing checked
- Memory, project sources and access deliberately configured
- Consumption, errors and total review time assessed together
Conclusion: relevant context and measured costs
Tokens describe processing; the context window sets its current boundaries. A reliable workflow needs appropriate sources, preserved conditions and checkable results. Budget using actual consumption instead of general page counts. To plan this setup, explore our AI automation service or tell us about your task.
Related reading: Why does AI need GPUs? Chips, data centres and prices.
Sources
Primary sources checked on 13 October 2026.
- Google: understand and count tokens
- OpenAI: tokenisation, Memory and business plans with context limits
- Anthropic: context windows, Sonnet 5.5 and Haiku 4.5
- Anthropic: compaction and token counting
- Liu et al.: Lost in the Middle, original study
- Anthropic: API pricing and prompt caching
- OpenAI: API pricing, reasoning billing and answer limitations
- Anthropic: RAG for projects




