📋 Executive Summary
I define what is a context window as an AI model’s finite working space for one request, but the number printed on a model card can conceal the more important limit: how much of that space remains accurate, affordable and operationally useful. In 2026, several leading APIs advertise around one million tokens, enough on paper for large codebases, lengthy case files or hundreds of document pages. Yet OpenAI’s own long-context evaluation shows GPT-5.6 Sol falling from 91.5% on an eight-needle task in the 256,000-to-512,000 range to 73.8% between 512,000 and one million tokens. The hard ceiling and the dependable ceiling are not the same thing.
That distinction changes how teams should plan AI search, document analysis, customer-support assistants, coding agents and retrieval-augmented generation. The context window is not simply the user’s prompt. It also contains system instructions, previous messages, uploaded files, tool definitions, retrieved passages, hidden or visible reasoning tokens, and the answer the model is about to generate. A nominal one-million-token model can therefore run out of usable room earlier than a quick word-to-token conversion suggests.
I have structured this guide around the decisions practitioners actually face. It explains how tokens are counted, why accuracy can decay before a request reaches the maximum, what current OpenAI, Anthropic, Google and Perplexity specifications mean, where pricing steps appear, and when long context should give way to retrieval or structured memory. The aim is not to crown the model with the largest number. It is to show how to build a context budget that survives real documents, repeated turns, tool calls, cost controls and the inconvenient fact that irrelevant information can make an AI less reliable rather than more informed.
What Is a Context Window in an AI Model?
A context window is the maximum sequence of tokens a model can consider while producing a response. A token is a model-specific unit that may represent a whole word, part of a word, punctuation or another encoded fragment. The window acts like a bounded workbench. Information placed on that workbench can influence the next output; information outside it cannot influence the generation unless the application retrieves, summarises or reintroduces it.
What Is a Context Window Made Of?
The total normally includes more than the text visible in a chat box. Anthropic’s current documentation states that system prompts, messages, tool results, images, documents, tool definitions, output and thinking can all consume the window. OpenAI similarly distinguishes a model’s total context from its maximum output. GPT-5.6 Sol advertises a 1,050,000-token context window and a 128,000-token maximum output, which means an application must reserve space for the response rather than fill the entire allowance with input.
A useful budgeting expression is: usable input equals total context minus reserved output minus provider or application overhead. The overhead can include tool schemas, safety instructions, connector metadata, formatting constraints and summaries of earlier turns. For an agent, every tool response can become fresh input on the next step. A workflow that begins with a modest prompt can therefore expand rapidly during browsing, code execution or database retrieval.
This is also why context is not the same as training data or permanent memory. Training gives a model general patterns and stored parameters. Context gives it request-specific evidence. A chat product may add a separate memory feature that stores user preferences, but those memories still need to be retrieved into the active request before they can affect the answer. Readers comparing current model families can use our GPT-5 model guide to separate the underlying model specification from the product interface that exposes it.
| Context Component | Typical Contents | Why It Matters |
| System and developer instructions | Role, policy, style, tools, output schema | Always-on instructions can consume a fixed share of every request. |
| Conversation history | Earlier questions, answers and corrections | Long chats repeatedly resend or summarise prior turns. |
| Files and retrieved passages | PDF text, code, database rows, web extracts | High-volume evidence can crowd out the most relevant details. |
| Tool definitions and results | Function schemas, search results, logs, calculations | Agent loops expand context on every tool call. |
| Reasoning and output reserve | Thinking tokens and the final answer | The model needs room to solve and respond, not only to read. |
How Tokens Turn Documents Into Capacity
Tokens are not a stable page-count unit. English prose often averages fewer tokens per word than code, tables, multilingual text or heavily punctuated data, but the ratio changes with the provider’s tokenizer. A 100-page contract and a 100-page source-code appendix may therefore occupy very different fractions of the same window. Images and PDFs can also be converted into text, visual tokens or both, depending on the model and endpoint.
Tokenizer changes can quietly alter capacity without changing a model’s headline context number. Anthropic reports that its newer tokenizer can produce around 30% more tokens for the same text than the earlier tokenizer. A document that previously occupied 100,000 tokens could therefore occupy about 130,000 under the new scheme. In practical terms, the same one-million-token limit would hold roughly 23% less of that document type because 1,000,000 divided by 1.3 is about 769,000 tokens on the older scale. This is an editorial calculation, not a universal conversion, but it shows why teams should count tokens with the target model’s own tokenizer rather than reuse estimates from another provider.
The effect becomes more important in multimodal work. Gemini 3.1 Pro accepts text, images, video, audio and PDF input, with a 1,048,576-token input limit and 65,536-token output limit. A developer may think in minutes of video or PDF pages, while the API bills and enforces encoded tokens. Claude’s one-million-token models can produce up to 128,000 output tokens, but Anthropic also documents request-level limits for images and PDF pages. Capacity planning must therefore combine token limits with modality-specific caps.
When comparing assistants, the practical question is not “How many pages fit?” but “How many target-model tokens remain after instructions, history and output reserve?” The ChatGPT and Claude comparison provides a broader product comparison, while the safer engineering habit is to run a token count before each request, reject or compress oversized inputs, and log the actual prompt, cached prompt and completion totals returned by the API.
Advertised Capacity Versus Usable Context
A model can technically accept a long prompt without using every part of it equally well. The gap between acceptance and dependable reasoning is the central long-context problem. Simple “needle in a haystack” tests ask a model to retrieve one planted fact. They are useful, but they can overstate performance on real work, where the model must connect evidence across distant sections, distinguish relevant from similar distractors, or maintain a chain of reasoning over many steps.
Eric H. C. Chow’s May 2026 study evaluated five frontier models with advertised one-million-token windows. The strongest systems achieved 100% on single-needle retrieval at one million tokens. Multi-hop reasoning told a different story. Some models remained above 80% through 512,000 tokens and degraded modestly at one million, while others suffered a late cliff or a smooth decline. Chow concluded that “nominal context-window length is a poor proxy” for usable multi-hop capability. That finding is more decision-relevant than a maximum-input figure because most professional analysis requires relationships, not isolated lookup.
OpenAI’s July 2026 launch data offers another visible example. GPT-5.6 Sol scored 91.5% on its eight-needle MRCR v2 band from 256,000 to 512,000 tokens, then 73.8% in the 512,000-to-one-million band. On GraphWalks breadth-first search, its F1 score moved from 90.7% at 256,000 to 77.1% at one million. These are vendor-reported evaluations rather than independent replications, but they reinforce the same operational conclusion: the end of the window is a stress zone, not a promise of uniform quality.
A reliable evaluation should therefore sweep several lengths and evidence positions. Test at 25%, 50%, 75% and near the maximum. Move decisive facts to the beginning, middle and end. Add semantically similar distractors. Measure exact retrieval, citation support, multi-hop accuracy, unsupported claims, latency and cost. The ChatGPT and Gemini analysis is useful for product-level trade-offs, but production selection needs task-specific curves rather than a single leaderboard score.
Context Rot, Lost-in-the-Middle and Attention Dilution
Context rot describes the decline in answer quality that can occur as a prompt grows, even while it remains below the formal limit. The model may retrieve a fact less reliably, over-weight recent material, miss evidence in the middle, blend similar entities or produce an answer that sounds coherent but ignores a controlling clause. The failure is not necessarily a literal loss of text. It is often a loss of effective attention or reasoning quality.
Three mechanisms matter. First, position bias can make the beginning and end of a prompt more influential than the middle. Second, distractor density can overwhelm a relevant fact with many plausible alternatives. Third, multi-hop tasks require the model to preserve intermediate results while searching elsewhere in the context. A window can therefore be large enough to hold all the evidence yet too noisy for the model to combine it safely.
Recent systems research adds a counter-intuitive point. A May 2026 paper by Ngoc Bui, Hieu Trung Nguyen, Arman Cohan and Rex Ying argues that retaining every key-value cache entry is not always optimal because irrelevant tokens can dilute attention. Their selective eviction method treated compression as a way to improve reasoning, not only save memory. The implication for application teams is straightforward: deletion can be an accuracy feature when it removes low-value context before the model sees it.
Practical mitigations include placing task instructions after long evidence as well as before it, using stable document identifiers, attaching line or paragraph references, grouping evidence by question, and asking the model to build an evidence ledger before drafting. For Claude workflows, the practical Claude usage guide complements this approach, but the principle is provider-neutral: preserve the smallest set of evidence that can answer the question, and keep provenance attached to every chunk.
Do not confuse prompt caching with context reduction. Caching can reduce input cost and latency for repeated prefixes, but cached tokens still occupy the active window. It changes economics, not the model’s attention budget. Compaction and summarisation can reduce occupancy, but they introduce a new failure mode: a summary may omit the detail that later becomes decisive.
Current Model Limits, Modalities and API Surfaces
The table below compares representative public specifications verified on 29 July 2026. It is deliberately scoped to model and API documentation rather than consumer chat interfaces, because products can expose smaller effective windows, plan-specific limits or automatic compaction. Model aliases and preview status can also change, so production systems should pin versions where the provider supports it and monitor deprecation notices.
| Model | Context / Output | Inputs | Key API Features and Integrations |
| OpenAI GPT-5.6 Sol | 1,050,000 / 128,000 tokens | Text; image input | Responses and Chat Completions APIs; reasoning; prompt caching; Batch; Realtime; Programmatic Tool Calling; multi-agent beta; web, file, MCP, shell, computer and code tools through supported APIs. Audio and video are not supported by this model. |
| Anthropic Claude Sonnet 5 | 1,000,000 / 128,000 tokens | Text and image; document workflows | Messages API; adaptive thinking; tool use; prompt caching; compaction; context awareness; Amazon Bedrock support. Priority Tier was not listed for Sonnet 5 at launch. |
| Google Gemini 3.1 Pro Preview | 1,048,576 / 65,536 tokens | Text, image, video, audio, PDF | Google AI Studio and Gemini API; context caching; Batch, Flex and Priority; code execution; function calling; structured output; URL context; Google Search and Maps grounding; custom-tools variant. |
| Perplexity Sonar | 128,000-token context | Text plus web-retrieved context | Sonar API; built-in web search; streaming; structured outputs; domain, date, language and location filters; low, medium or high search context; OpenAI-compatible request patterns for common integrations. |
OpenAI’s model page also lists separate endpoints for Realtime, translation, transcription, Assistants, fine-tuning, embeddings and media generation, but not every listed platform endpoint means GPT-5.6 Sol itself supports every modality. The page explicitly marks text as input and output, image as input only, and audio and video as unsupported. This is an important specification-reading habit: distinguish the platform’s endpoint catalogue from the model’s own modality support.
“carry context across long sessions with strong grounding”
Ian Tracey, Software Engineer, Applied AI at Ramp, quoted in OpenAI’s July 2026 GPT-5.6 launch announcement.
Perplexity requires another distinction. Sonar’s 128,000-token context is a model limit, while low, medium and high “search context” control how much web information the service retrieves and the request fee. The Perplexity Sonar model guide explains the search-first architecture. Treating search context as if it were the full model window leads to incorrect capacity and cost assumptions.
The Price of a Long Prompt
Long context changes cost in three ways. It increases input tokens, can increase output or reasoning tokens, and may cross a provider’s higher pricing band. A team that budgets from the base per-million rate can therefore underestimate the cost of the requests most likely to fill the window. Caching may reduce repeated-prefix charges, but it can add write or storage charges and does not shrink the context itself.
| Service | Standard Input / Output | Long-Context or Hidden Cost | Verified Limitation |
| OpenAI GPT-5.6 Sol | $5 / $30 per 1M tokens | Requests above 272K input tokens are charged at 2x input and 1.5x output for the full request. Cached input is $0.50 per 1M, while cache writes are billed at 1.25x uncached input. | 1,050,000 context; 128,000 max output; text and image input only. |
| Anthropic Claude Sonnet 5 | $2 / $10 introductory through 31 August 2026; standard $3 / $15 | One-million-token context is billed at standard model rates. Prompt caching has separate write and read rates; newer tokenisation can change the measured length of identical text. | 1M context; 128K max output; Priority Tier not available at launch. |
| Google Gemini 3.1 Pro Preview | $2 / $12 at 200K tokens or less | $4 / $18 above 200K. Cache input rises from $0.20 to $0.40, plus $4.50 per 1M cached tokens per hour. Search or Maps grounding beyond the free allowance is billed per query. | 1,048,576 input; 65,536 output; preview model and price bands may change. |
| Perplexity Sonar | $1 / $1 per 1M tokens | $5, $8 or $12 per 1,000 requests for low, medium or high search context. The request fee is separate from token charges. | 128K model context. Search context is retrieval depth, not a larger model window. |
A full-window price calculation should include the actual threshold rule. For example, an OpenAI request with 300,000 input tokens is not billed with only the final 28,000 at the higher rate. The model page states that the multiplier applies to the full request once input exceeds 272,000. Google’s Gemini 3.1 Pro similarly applies its higher per-token band above 200,000 tokens. Both price cliffs appear far before the models’ one-million-token ceilings.
“38% with no quality loss”
Angel Faus, VP of Engineering at Clio, describing prompt-token reduction from Programmatic Tool Calling in OpenAI’s July 2026 announcement.
The lesson is not that long context is too expensive. It is that architecture determines whether the expense buys useful evidence or repeated noise. The Gemini Advanced feature guide adds product context, while API teams should model at least four scenarios: median prompt, 95th-percentile prompt, near-threshold prompt and near-maximum prompt. Include cache writes, cache storage, tool calls, retrieval fees, retries and expected conversation length.
How Context Changes Chat, RAG and Agents
The same context window behaves differently across three common architectures. A chat assistant usually carries conversation history and user files. A retrieval-augmented generation system searches an external index and inserts selected chunks. An agent adds tool definitions, intermediate plans, observations, logs and repeated model calls. The agent can consume the same context budget many times during one user task.
In chat, the main risk is unbounded history. Resending every turn preserves detail but increases cost and can amplify contradictions. Summarising history controls size but can erase commitments or caveats. A robust design keeps structured state separately, such as decisions, user preferences, open questions and cited facts, then retrieves only the state needed for the next turn.
In RAG, the risk is retrieval quality. Too few chunks omit evidence; too many chunks create distractors. Chunk size, overlap, metadata, reranking and query decomposition often matter more than the maximum context. The model should receive an evidence set that is complete enough to answer but small enough to audit. For regulated or high-stakes work, require the answer to cite chunk identifiers and refuse claims without supporting passages.
Agents add a second loop. Each tool call can append results and then trigger another generation. Tool schemas themselves can be large. OpenAI’s Programmatic Tool Calling addresses part of this by letting GPT-5.6 coordinate tools and process intermediate results in memory. Alberto Da Costa, Principal Engineer for Applied AI at Balyasny Asset Management, reported the model was “1.72x more token-efficient” in the firm’s evaluation. That is a vendor-selected customer statement, not an independent benchmark, but it points to a valuable metric: successful task completion per total token, not context size alone.
A strong agent framework keeps raw artefacts outside the prompt, stores tool outputs by identifier, and passes compact summaries plus retrieval handles. The step-by-step prompt engineering guide helps with instruction design, but context engineering goes further by deciding what information enters, persists, expires and returns at every step.
A Step-by-Step Context Engineering Workflow
Context engineering is the deliberate construction of the information set a model receives. The workflow below is designed for document analysis, research assistants, coding agents and knowledge-base systems. It avoids the common mistake of filling the window first and evaluating later.
- Define the decision. Write the exact question, required output, acceptable evidence and failure cost. A broad request creates broad retrieval and unnecessary tokens.
- Inventory every token source. Count system instructions, examples, tool schemas, history, files, retrieval results, reasoning allowance and output reserve separately.
- Set a hard budget below the provider maximum. Keep operational headroom for tool calls, retries and the final answer. For very long workflows, reserve at least one compaction or recovery step.
- Segment evidence by function. Separate governing instructions, primary evidence, supporting evidence, counter-evidence and background. Attach source IDs and dates before insertion.
- Retrieve, rerank and deduplicate. Remove near-duplicates, boilerplate and navigation text. Prefer passages that directly answer sub-questions over whole documents when provenance remains intact.
- Order the prompt deliberately. Put stable instructions in a cacheable prefix, present evidence in labelled blocks, and repeat the task and answer constraints after the evidence.
- Ask for an evidence ledger first. Require the model to map each intended claim to a source identifier before producing polished prose or a final decision.
- Run length and position sweeps. Evaluate at multiple context sizes, move key facts through the prompt, and record retrieval accuracy, citation support, latency, token use and cost.
- Compact by policy, not panic. When nearing the budget, preserve decisions, unresolved issues, entity facts and source handles. Drop transient narration and redundant tool output.
- Monitor production drift. Alert on token spikes, threshold crossings, truncation, unsupported claims, retry loops and sudden changes after model or tokenizer upgrades.
During our 2026 editorial evaluation, this workflow exposed two easily missed constraints. First, a cached prefix remains inside the window even when its read price is discounted. Second, a summary is a lossy transformation, so the original source must remain retrievable by identifier. These details are more consequential than choosing a slightly larger nominal window because they determine whether a system can recover when the model omits an important fact.
The best AI chatbot comparison can help readers choose a user-facing assistant. For production engineering, the better comparison unit is an end-to-end workflow with the same evidence, output specification and acceptance test across providers.
Performance Bottlenecks and Known User Constraints
Long context creates compute and product constraints that do not appear in the token limit. Transformer inference must manage a key-value cache that grows with sequence length. More tokens generally mean more memory pressure, longer prefill time and higher cost. Providers can optimise this with specialised attention, caching, batching and hardware, but users still experience the result as latency, rate limits or lower throughput.
The first bottleneck is prefill latency, the time required to process input before the model begins generating. A one-million-token prompt can be unsuitable for an interactive interface even if the endpoint accepts it. The second is repeated-read cost in multi-turn applications. Each new turn can resend a large history unless the platform offers state, caching or compaction. The third is output reservation. A model with a 128,000-token output maximum does not guarantee that every application will expose that allowance or that a long answer remains coherent.
The fourth bottleneck is tool expansion. Search results, stack traces, database rows and function schemas can overwhelm a prompt with low-value detail. The fifth is modality conversion. PDFs may contain scanned pages, hidden text layers, complex tables or diagrams that require separate extraction. Video and audio inputs can consume tokens at rates that are difficult to estimate from file size alone. The sixth is provider-specific caps, such as limits on images, document pages, request payload size, rate or concurrent jobs.
User-facing products add another layer. A subscription may provide access to a model family without exposing the API’s full context, full output or pricing logic. Automatic summarisation can make a conversation seem continuous while older details have already been compressed. Teams should distinguish the model card, API endpoint, SDK, cloud-hosted variant and chat product. The practical rule is to validate the exact surface that will run in production, including its application-level history handling, automatic compaction, rate limits and attachment constraints.
A reproducible load test should record time to first token, total generation time, prompt and completion tokens, cache reads and writes, tool calls, retries, truncation behaviour and answer quality. Run it with representative documents, not synthetic filler alone. A model that retrieves a unique sentence from random text may still fail on fifty similar clauses in a real policy manual.
When a Bigger Window Is the Wrong Architecture
A large context window is strongest when the task depends on global structure inside a bounded corpus. Examples include tracing a character arc across a novel, understanding a codebase refactor that touches many files, comparing clauses across a contract set, or synthesising a modest collection of research papers. It is weaker when the corpus changes continuously, the same history is replayed many times, evidence must be permission-filtered, or the relevant facts form a tiny share of a huge collection.
Structured memory can outperform repeated full-history prompts on cost even when it sacrifices some recall. Pollertlam and Kornsuwannawit compared a fact-based memory system with long-context inference on three memory benchmarks. At a 100,000-token context, their cost model found the memory system became cheaper after about ten interaction turns, with the break-even point arriving sooner as context length increased. They described the memory system’s “per-turn read cost remains roughly fixed” after its write phase, while long-context inference continued to pay for an expanding history.
RAG is the better default when evidence is sparse, frequently updated or distributed across a corpus too large to load. Structured memory is useful for persistent entities, preferences and commitments. Long context is valuable for final synthesis after retrieval has narrowed the evidence. Many production systems therefore use a hybrid: retrieve a focused set, preserve key state separately, and give the model enough surrounding context to reason across the selected evidence.
| Architecture | Best Fit | Main Risk | Decision Signal |
| Full long context | One bounded corpus with dense cross-document relationships | Latency, cost and context rot | Most of the corpus is relevant to one answer. |
| RAG | Large or changing knowledge bases with sparse relevance | Missed retrieval or poor chunking | Only a small fraction of the corpus matters per query. |
| Structured memory | Persistent users, agents and repeated interactions | Extraction errors and stale facts | The same stable facts recur across many turns. |
| Hybrid | Complex production systems needing recall and global reasoning | More components and evaluation burden | Different information types have different lifetimes. |
The original angle for this guide is therefore not “bigger versus smaller”. It is evidence lifetime. Instructions may live for a session, retrieved passages for one answer, user facts for months, and raw tool logs for seconds. Context architecture improves when each information type receives an explicit retention, retrieval and expiry policy.
Choosing the Right Context Strategy
Start with the task’s evidence density. If nearly every section of a document may affect the answer, long context is valuable. If only a handful of passages matter, retrieval reduces noise. Next consider repetition. A one-off analysis can justify a large prompt; a support agent that replays the same 300,000 tokens across hundreds of turns usually cannot. Then consider failure cost. High-stakes decisions need provenance, refusal rules and human review regardless of window size.
Model selection should follow measured performance at the lengths you use. Compare at the same token count, prompt structure, evidence order and output reserve. Include at least one adversarial test with similar distractors and one multi-hop test that requires evidence from distant locations. Use a smaller model as a routing or compression layer only after testing whether it preserves the facts that the larger model needs.
Pricing should be treated as a curve. OpenAI’s surcharge above 272,000 input tokens and Google’s higher Gemini 3.1 Pro band above 200,000 create discontinuities. A design that keeps most requests just below a threshold can be substantially cheaper than one that occasionally crosses it with boilerplate. Perplexity adds retrieval request fees based on search context, which means web depth and model tokens must be budgeted separately.
Finally, prefer reversible compression. Store original sources outside the prompt, attach stable identifiers, and let the model request the original passage when a summary is insufficient. This creates an escape route from context loss. It also improves auditability because reviewers can trace a claim back to the uncompressed evidence.
A sensible 2026 default is: count first, retrieve second, reason over the smallest complete evidence set, reserve output space, and measure accuracy near the lengths that trigger higher prices. A million-token model can be the right choice, but the winning system will often use only a fraction of that capacity on most requests.
Our Editorial Verification Process
We verified model context limits, output caps, modality support, endpoint availability and pricing against public documentation from OpenAI, Anthropic, Google and Perplexity as available on 29 July 2026. We separated model-level specifications from chat-product limits and treated preview features, introductory prices and provider-selected customer statements as time-sensitive. Where a vendor page listed a platform endpoint but marked a modality unsupported for the specific model, the model-level limitation governed our table.
For performance claims, we cross-referenced OpenAI’s published MRCR and GraphWalks long-context results with Eric H. C. Chow’s May 2026 one-million-token retrieval and multi-hop study. For architecture economics, we used the March 2026 comparison by Natchanon Pollertlam and Witchayut Kornsuwannawit. We did not convert benchmark results into a universal “usable token” number because performance depends on task, evidence position, distractor similarity, language and prompt design.
Pricing calculations use listed per-million-token rates and documented threshold rules. The 30% tokenizer example is an arithmetic illustration of effective capacity, not a claim that every document grows by the same amount. Consumer subscription prices and message limits were excluded from the core matrix because they can vary by region, plan and interface, and they do not necessarily expose the API model’s full context.
This article was researched and drafted with AI assistance and reviewed by the Sami Ullah Khan editorial desk at Perplexity AI Magazine. All data, citations, pricing figures, and named quotes have been independently verified against primary sources before publication.
Conclusion
A context window is best understood as a finite, shared budget for instructions, evidence, history, tools, reasoning and output. The million-token era has made previously impractical tasks possible, but it has not removed the need for retrieval, memory design or evaluation. Current documentation shows generous hard limits alongside earlier economic thresholds, modality caps and product-level constraints. Current research shows that simple retrieval can remain strong while multi-hop reasoning weakens near the top of the same window.
The practical response is not to distrust long context. It is to use it deliberately. Count with the target tokenizer, reserve room for the answer, test evidence at different positions, log cost and latency, keep original sources retrievable, and compress according to information lifetime. A context window becomes useful memory only when the application controls what enters it and what leaves.
Open questions remain. Providers continue to change tokenisation, caching, agent orchestration and pricing. Benchmarks still struggle to represent messy corporate documents, conflicting evidence and repeated tool use. Future models may make the upper end of the window more reliable, but architecture will continue to matter because unlimited information is not the same as relevant information. The most capable system will be the one that knows not only how much context it can hold, but which context deserves to be there.
Frequently Asked Questions
How Many Words Are in a 128K Context Window?
There is no fixed conversion because tokenisation varies by language, code, punctuation and model. English prose may fit more words than code or multilingual text. Count the exact input with the target provider’s tokenizer, then reserve space for system instructions, tools, reasoning and the answer.
Is a Context Window the Same as AI Memory?
No. The context window is temporary working space for one generation. Product memory, external databases and retrieval systems store information outside the window, then reinsert selected facts when needed. Training data is different again because it is encoded in model parameters rather than supplied as request evidence.
Does a Larger Context Window Make an AI More Accurate?
Not automatically. A larger window allows more evidence, but irrelevant or similar material can dilute attention. 2026 studies show that single-fact retrieval may remain excellent at one million tokens while multi-hop reasoning degrades. Accuracy must be tested at the actual lengths and evidence patterns used in production.
What Happens When a Prompt Exceeds the Context Window?
The API may reject the request, truncate content, compact earlier turns or require a smaller output allowance, depending on the provider and product. Silent truncation is especially risky. Applications should count tokens before sending, set explicit limits and verify which content remains after any summarisation or compaction.
Do Cached Tokens Still Count Toward the Context Window?
Yes. Prompt caching can reduce the price or processing time of repeated input, but cached tokens still occupy context. Caching changes billing and latency, not the amount of information the model must attend to. To free space, the application must remove, summarise or retrieve content selectively.
Is RAG Still Needed With One-Million-Token Models?
Yes for many systems. RAG remains useful when a corpus is large, frequently updated, permission-sensitive or only sparsely relevant to each query. Long context is valuable for reasoning over the retrieved set. Hybrid systems often combine retrieval, structured memory and a long-context model.
Why Does Long-Context Pricing Rise Before the Maximum?
Providers price for the additional compute and memory required by long inputs. As of 29 July 2026, OpenAI applies higher rates above 272,000 input tokens for GPT-5.6 Sol, while Google Gemini 3.1 Pro raises rates above 200,000 tokens. The exact thresholds are provider-specific and can change.
What Is the Safest Context Budget for an AI Agent?
Use a budget below the formal maximum and reserve room for tool outputs, retries, reasoning and the final response. Keep raw artefacts outside the prompt, retrieve them by identifier, compact transient logs and test the workflow at its 95th-percentile context length rather than only the median.
References
OpenAI. (2026). GPT-5.6 Sol model documentation.
OpenAI. (2026, July 9). GPT-5.6: Frontier intelligence that scales with your ambition.
Anthropic. (2026). Context windows. Claude Platform Documentation.
Anthropic. (2026). Models overview. Claude Platform Documentation.
Google. (2026). Gemini 3.1 Pro Preview model documentation.
Google. (2026). Gemini Developer API pricing.
Perplexity. (2026). Sonar API pricing.
Chow, E. H. C. (2026). Retrieval and multi-hop reasoning in 1M-token context windows. arXiv.