A context window describes the model’s documented capacity for the material involved in a request. Plan the input and output together, then test whether the model uses the supplied evidence well.

Definition with a live example

Claude’s context guide explains how request material and generated output relate to the model’s context accounting. Official documentation.

Think of capacity as a constraint on what the operation can process, not a promise that every included passage will influence the answer correctly. A document can fit while the application still retrieves the wrong evidence, asks an ambiguous question or accepts an unsupported response. Capacity and useful reasoning should remain separate evaluation questions.

Only active candidates with documented values for this ranking are included. Prices retain the tier and deployment condition shown below.

Models ranked by context
ModelProviderInput USD / 1MOutput USD / 1MCached input USD / 1MContext tokensPrice conditionCost
SpaceXAI: Grok 4.20OpenRouter$1.25$2.5$0.22,000,000StandardEstimate cost
SpaceXAI: Grok 4.20 Multi-AgentOpenRouter$1.25$2.5$0.22,000,000StandardEstimate cost
DeepSeek: DeepSeek V4 Flash 0731OpenRouter$0.04$0.08$0.0081,310,720StandardEstimate cost
DeepSeek: DeepSeek V4 Flash LatestOpenRouter$0.03$0.07$0.0031,310,720StandardEstimate cost
Meta: Llama 4 ScoutOpenRouter$0.1$0.3Not documented1,310,720StandardEstimate cost
Z.ai: GLM 5.3OpenRouter$1.4$4.4$0.261,310,720StandardEstimate cost

Last verified · Source ↗

The live list shows documented capacity with source evidence. Use it to eliminate candidates that cannot support the intended request shape, then inspect the exact model’s output allowance and feature conditions. A large catalog number should not be interpreted as permission to fill the request without leaving room for its intended result.

A context plan begins with the application’s assembled input. Include instructions, tool schemas, retrieved passages and relevant history. Preserve a margin for the output contract and any model-specific accounting described by the provider. A capacity error often reflects material that the developer did not realize the framework was adding.

For a document fixture, keep a map of which passages justify each requested field. This makes it possible to judge whether the model’s answer uses the supplied evidence. Include a missing-fact case and a conflicting-source case so the evaluation measures behavior beyond simply finding a phrase.

PNG showing context input categories plus output allowance, with full-document and retrieve/summarize alternatives and explicit validation stage.

How it affects cost / limits / results

Longer input can increase billable work even when the same price category applies. Some model schedules also attach a different category to a qualifying context range. The title of this guide does not imply that every larger context changes the unit rate; inspect the live model pricing and the actual request amount separately.

Use the workload calculator to compare a full-document request with a deliberately selected-evidence request. Keep the required answer quality fixed and retain any retrieval or merge stages in the second scenario.

A large window can simplify a workflow by allowing relevant material to stay together. It can also encourage the application to include irrelevant content that obscures the task. Test the smaller focused request against the larger one rather than assuming either is always better. Record accepted results and usage, not only whether the API accepted both payloads.

For conversations, decide what history the next turn truly needs. A summary can reduce repeated input, but it can also lose a constraint or source attribution. Validate that compressed state against a fixture with important earlier instructions. Keep an escape path to the original evidence when a later task needs details that were omitted.

When a document is too large, splitting is an application design choice. Preserve section boundaries, source identifiers and the evidence needed to combine results. A final synthesis should know which statements are supported by which pieces, and it should not invent a global conclusion because separate local summaries sound compatible.

Provider differences

Anthropic documents context accounting and model-specific handling in its context-window guide. Read the selected model’s conditions before budgeting a long response.

Google offers long-context guidance for Gemini. Use the task-specific recommendations as hypotheses to evaluate with your own document fixture.

Alibaba Model Studio includes qualifying input conditions in model pricing. Keep the model and applicable tier together when forecasting long-document work.

The provider differences show why a single maximum is an incomplete operating specification. Request fields, media accounting, output constraints and pricing conditions can differ. Preserve the endpoint and exact model when comparing capacity so the test is attached to a reproducible configuration.

For a router or alternative host, inspect the serving route’s documented context and output configuration. A related model name does not prove that every host accepts the same request shape. Keep the actual host in the evaluation record and investigate missing fields rather than copying another provider’s capacity value.

Common mistakes

Do not equate fitting with correctness. Check whether answers cite or otherwise identify the right supplied evidence, handle absence and respect contradictory material. A model can accept a document while answering from a mistaken interpretation.

Do not remove source context blindly to repair a capacity error. First inspect the assembled request and remove genuinely irrelevant or duplicate material. Preserve the information necessary to verify the requested result.

Do not assume that a longer window always means a higher unit price, or that an unchanged unit price makes longer input free. Amount and qualifying price conditions are separate parts of the estimate.

Do not hide truncation. If the application drops input or receives incomplete output, expose that state and keep it outside accepted results. Silent loss of the important ending of a document is harder to diagnose than a visible capacity failure.

Last verified · Source ↗

Frequently asked questions

Does a large context window guarantee good document answers?
No. Evaluate grounding, relevance and missing-evidence behavior separately.
Should I leave room for output?
Plan the complete request according to the model’s documented accounting and output conditions.
Does more context always change the unit rate?
No. Some schedules have qualifying tiers and others do not; inspect the applicable price row.
What can a framework add to the input?
Instructions, tool definitions, history and retrieved material can expand the assembled request.
Is splitting a document always cheaper?
Include every extraction and synthesis stage and compare accepted results before deciding.
What should happen when material is truncated?
Keep truncation visible and avoid treating the result as a complete accepted answer.

Sources

Last verified · Source ↗