Explainer

LLM Context Windows Explained (With Real Limits Table)

A context window is the maximum amount of text a model can hold in a single request, and cost scales with how much of it you actually fill. Anthropic's Claude 4.6-and-later models bill the full 1M token window at standard per-token rates with no long-context surcharge, which is the clearest documented case in this comparison.

ToolEntry planPaid fromNotesVerified
Anthropic API$1/MTok input (Claude Haiku 4.5)Output $5 per MTok; cache hits $0.10 per MTok; batch $0.50 in / $2.50 out2026-08-28
Google Gemini APIFree — Free tier$0.3/MTok input (Gemini 3.5 Flash-Lite)Output $2.50 per MTok2026-08-28
OpenRouterFree — InferenceOpenRouter passes through provider pricing without markup on API usage2026-08-28
DeepSeek$0.44/MTok input (cache miss, peak) (deepseek-v4-flash)Off-peak $0.22 per MTok. Cache hit $0.014 peak / $0.007 off-peak. Output $1.32 peak / $0.66 off-peak2026-08-28

Pricing verified: 2026-08-28 — fromAnthropic APIGoogle Gemini APIOpenRouterDeepSeek

The short definition

A context window is the maximum amount of text — prompt, conversation history, and any attached documents — that a model can process in a single request before it starts dropping earlier content. The window itself is a capacity limit, not a price; what determines your bill is how many tokens you actually send and receive against that limit. Anthropic's documentation is the clearest on this point in the fact sheet available here: Claude 4.6 and later models include the full 1M token context window at standard per-token pricing, with no separate long-context surcharge layered on top.

How it actually works

Cost scales directly with tokens sent and received, so filling more of a context window costs proportionally more regardless of which provider you use. On the Anthropic API, Claude Opus 5 runs $5 per million input tokens and $25 per million output tokens, Claude Sonnet 5 runs $2 in and $10 out, and Claude Haiku 4.5 runs $1 in and $5 out — all at the same flat rate no matter how much of the available window a given request actually fills.

ProviderInput rate (example model)Notable context-cost mechanism
Anthropic API$2/MTok in, $10/MTok out (Sonnet 5)1M token window billed at standard rate; cache hits at 0.1x input
Gemini API$1.50/MTok in, $9.00/MTok out (3.5 Flash)Gemini 2.5 Pro pricing splits at the 200k token mark
DeepSeek$0.44/MTok in peak, $0.22 off-peak (v4-flash)Off-peak rates half of peak; cache hits ~30x cheaper than misses
OpenRouterPass-through, no markupInference priced at whatever the underlying provider charges

The mechanism that actually makes large contexts affordable is caching, not the window size itself. Anthropic charges cache reads at 0.1x the base input price, with a 5-minute cache write costing 1.25x base input and a 1-hour write costing 2x — and that caching discount stacks with the 50% Batch API discount for asynchronous work. DeepSeek's cache hits are priced even more aggressively in absolute terms, at $0.014 per million tokens at peak and $0.007 off-peak on deepseek-v4-flash, which is roughly 30x cheaper than a cache miss on the same model. Gemini's pricing takes a different shape: Gemini 2.5 Pro's rate depends on whether the prompt falls under or over 200k tokens, so cost per token is not flat across the window the way it is on Anthropic or DeepSeek.

When you need it — and when you do not

You need a large context window when a single request genuinely requires the model to reason over material it can't afford to lose — a long document, an entire codebase, or a multi-turn conversation you don't want to summarize away. For most day-to-day prompts, though, a smaller effective context — trimmed history, retrieved snippets instead of whole documents — costs less and often performs just as well, since every token in the window is a token you're paying to send and the model has to attend to.

The economics change once you're sending the same large context repeatedly. A one-off 100k-token request is just an expensive request. The same 100k-token context reused across ten calls is where caching mechanics matter: Anthropic's 0.1x cache-hit price or DeepSeek's near-free cache hits turn a repeated large context from a recurring cost into a one-time setup cost. If your workload doesn't repeat the same context, caching discounts don't help you, and you should optimize for keeping the window small instead.

Free and low-cost tiers are worth knowing about if you're just testing how large-context behavior holds up before committing budget. Gemini's free tier includes free input and output tokens on certain models through Google AI Studio, though content sent there is used to improve Google's products, which rules it out for anything confidential. OpenRouter's free models, rate-limited to 50 requests a day, are another no-cost way to prototype before you're paying per token at all.

The tools that do this

Anthropic, Gemini, DeepSeek, and OpenRouter each expose context-window capacity differently, and picking between them depends more on your caching and repetition pattern than on the raw window number. Anthropic is the most transparent on long-context billing in this fact sheet: the full 1M token window at Claude 4.6 and later is billed at the standard rate, and prompt caching at 0.1x input price is well documented and stacks with the Batch API's 50% discount. If you're deciding between Anthropic and OpenAI for a coding-heavy workload, Claude API vs OpenAI API covers that comparison directly.

DeepSeek is worth considering if your workload can tolerate off-peak scheduling — peak hours run 01:00-04:00 and 06:00-10:00 UTC on weekdays, and shifting large-context calls outside that window halves the input cost outright, before cache-hit discounts are even applied. OpenRouter's appeal isn't a special context-window mechanic; it's that inference is passed through at provider pricing with no markup, so you can route a large-context request to whichever underlying model handles it best without opening a second account. For a broader look at cost across coding-specific workloads, see best LLM API for coding tasks, and for a pure price comparison across providers, cheapest LLM API in 2026 breaks down the real math.

None of these providers publish a single "context window" number that stands alone from pricing in the fact sheet used for this comparison, which is itself a useful signal: the window size matters less in practice than the per-token rate and the caching mechanics layered on top of it. Two models with the same nominal window can cost very differently once you factor in whether cache hits are supported, how peak and off-peak windows are defined, and whether pricing splits at a token threshold like Gemini's 200k mark. Before picking a provider for a large-context workload, model your actual repetition pattern first — a one-off long request and a repeatedly-reused large context are effectively different products from a cost standpoint, even on the same API.

Frequently asked questions

Does a bigger context window always cost more?

Not necessarily on a per-token basis, but you pay for every token you send, so a fuller context window costs more in absolute terms regardless of the per-token rate. Anthropic bills its full 1M token window at the same standard rate as smaller requests, with no separate long-context surcharge.

What is prompt caching and how does it change context window economics?

Prompt caching lets you reuse a large context — a system prompt or document — across requests at a discount instead of paying full price every time. On the Anthropic API, cache hits cost 0.1x the standard input price, which is the mechanism that makes large contexts affordable to reuse repeatedly.

Is there a free way to test large context windows?

Google's Gemini API has a genuine free tier with free input and output tokens on certain models through Google AI Studio, though free-tier content is used to improve Google's products. OpenRouter also offers free models rate-limited to 50 requests per day, rising to 1,000 after a $10 credit purchase.

Why does DeepSeek's context cost change by time of day?

DeepSeek prices peak hours (01:00-04:00 and 06:00-10:00 UTC, Monday through Friday) at double the off-peak rate, so sending the same large context outside peak hours costs half as much. Cache hits are roughly 30x cheaper than cache misses on top of that, which compounds with off-peak timing for repeated large-context calls.