Million-Token Context Windows: What Long Context Actually Does to Your Infrastructure

Picture of DataStorage Editorial Team

DataStorage Editorial Team

AI Infrastructure & Workflows 11 min read  ·  October 2026
A coding agent that ends its task with 830,000 tokens in context has re-sent 17.6 million. Which price you pay for that depends almost entirely on caching.

A coding agent that finishes its task with 830,000 tokens of context in its window has not processed 830,000 tokens. Across 40 turns it has re-sent its growing history every time, for a total of 17.6 million input tokens. At Claude Opus 5.5 list prices that one session costs $72.00 uncached. Cached properly, it costs $9.10. Most teams find out which of those two numbers they are paying when the invoice lands.

That gap is the real story of million-token context windows. The headline feature is how much a model can read. The infrastructure consequence is how much your stack has to hold, move, cache and re-send, and who pays for it. This guide breaks down what long context does to GPU memory, API bills and storage, with worked numbers, so you can decide when a million tokens is worth it and how to stop paying for the same context forty times.

328 GB
KV cache for one 1M-token session, 70B-class model at FP16
DataStorage.com calculation, 2026
17.6M
Input tokens re-sent across one 40-turn session ending at 830K context
DataStorage.com model, 2026
60% to 7%
Share of context recomputed, HBM-only vs NVMe KV tier
Weka and Nebius benchmark, 2026
+15 to 20%
4Q26 NAND flash contract price forecast, quarter over quarter
TrendForce, 2026
GPU Marketplace
Compare GPU Cloud Providers in One Place
Long context is won or lost on HBM per GPU and what sits behind it. Browse pricing, availability and specs across CoreWeave, Lambda Labs, Nebius, Vultr and more, all on DataStorage.com.
Explore GPU Providers  →

Why Long Context Is a Budget Question in Late 2026

Three things changed this year. First, pricing flattened. Anthropic's pricing documentation (2026) states that Claude 4.6 and later models, except Haiku 5.5, bill the full 1M-token window at standard rates, so a 900K-token request costs the same per token as a 9K-token request. Google's Gemini API pricing page (October 2026) still charges Gemini 3.1 Pro $2.00 per million input tokens at or under 200K and $4.00 above it, with output rising from $12.00 to $18.00. The cliff that used to force discipline is gone on one major platform and intact on another.

Second, the hardware industry started treating context as its own storage class. NVIDIA announced BlueField-4 STX at GTC in March 2026, with a context memory platform built specifically to hold KV cache in flash, and said partner systems would ship in the second half of 2026. CoreWeave, Lambda Labs, Nebius, Vultr and Oracle Cloud Infrastructure were named as early adopters.

Third, the flash that context memory runs on got expensive. TrendForce (September 30, 2026) forecasts NAND contract prices up another 15 to 20 percent quarter over quarter in 4Q26 and names enterprise SSD as the only memory category where price growth is accelerating, driven by AI inference and agentic caching.


What a Million Tokens Weighs in GPU Memory

Every token a transformer has already read is stored as keys and values in the KV cache (key-value cache), so the model does not recompute the whole history to generate the next token. The KV cache grows linearly with context length and lives, by default, in GPU high-bandwidth memory (HBM).

The arithmetic is simple. A 70B-class model built on the Llama 3.1 70B architecture (80 layers, 8 key-value heads, head dimension 128) stores about 328 KB of KV cache per token at FP16 precision. That is roughly 42 GB at 128K tokens and 328 GB at 1M tokens, for a single session. Quantizing the cache to FP8 halves it, to about 164 GB.

Context FP16 FP8 Share of one 270 GB GPU
128K tokens 42 GB 21 GB 16%
200K tokens 66 GB 33 GB 24%
500K tokens 164 GB 82 GB 61%
1M tokens 328 GB 164 GB 121%
KV cache for a single session. Llama 3.1 70B architecture: 80 layers, 8 KV heads, head dimension 128. Share column uses FP16.

Why this breaks serving economics

An 8-GPU NVIDIA B300 node in the Weka and Nebius benchmark (2026) carried about 270 GB of HBM3e per GPU. Even with that much memory, the benchmark authors note that HBM holds only a few dozen long-context sessions before it starts evicting. Once a session's cache is evicted, its next turn pays the full prefill cost again: the GPU recomputes context it has already seen. NVIDIA's own technical blog (2026) makes the same point: KV cache capacity grows in proportion to context, while the compute needed to rebuild it grows much faster.

This is why long context is not just a model feature. A provider serving million-token sessions either buys far more HBM per user, accepts slow and expensive recompute, or adds a cache tier underneath the GPU. All three cost money, and all three end up in your price or your latency.


Why Flat Long-Context Pricing Can Raise Your Bill

Long-context costs rarely come from one giant request. They come from re-sending. Agents and chat sessions are stateless at the API: each turn ships the full history back to the model. A session that grows steadily from 50K to 830K tokens over 40 turns sends 17.6 million input tokens in total, more than 21 times its final context size.

Remove the surcharge at 200K and teams stop trimming. That is good for capability and bad for spend, the same pattern we see across AI infrastructure: a cheaper token is not a cheaper bill. Note too that Anthropic says Claude 4.7 and later models use a new tokenizer that produces roughly 30 percent more tokens for the same text, so a per-token price comparison against older models understates the change.

The table below models one such session across current list prices, then scales it to a 200-engineer team running five sessions a day.

Scenario Pricing basis Per session Monthly
Claude Opus 5.5, no caching $4 in / $20 out $72.00 $1,512,000
Claude Opus 5.5, cached, 6 cache misses write 1.25x, read 0.05x $23.79 $499,590
Claude Opus 5.5, cached, no misses write 1.25x, read 0.05x $9.10 $191,100
Gemini 3.1 Pro, no caching $2 / $4 in, $12 / $18 out $69.82 $1,466,220
Claude Sonnet 5.5, cached, no misses write 1.25x, read 0.05x $4.55 $95,550
Model: 40 turns, context growing from 50K to 830K tokens in 20K steps, 2K output tokens per turn, list prices as of October 2026. Monthly = 21,000 sessions (200 engineers x 5 sessions x 21 working days). Gemini applies the over-200K rate on 32 of 40 turns. Cache-miss scenario rewrites full context at 1.25x on 6 turns.

Caching is the line item that decides the bill

Prompt caching is what turns $72.00 into $9.10. On Claude Opus 5.5 and Sonnet 5.5, Anthropic prices a cache hit at 5 percent of the base input rate, a 5-minute cache write at 1.25 times base, and a 1-hour write at 2 times base. The catch is expiry. A developer who steps away for longer than the cache lifetime comes back to a cold cache, and the next turn rewrites the entire context at the write premium. In our model, just 6 misses out of 40 turns lift the session from $9.10 to $23.79, and the monthly bill from $191,100 to $499,590.

Explicit caches can also carry a holding charge. Google lists Gemini 3.1 Pro context caching storage at $4.50 per million tokens per hour. Holding an 830K-token context for an 8-hour workday costs about $29.88 in storage alone, before a single token is read. That is reasonable for a shared corpus queried by hundreds of users and wasteful for one engineer's session.

Treat cache hit rate as a FinOps metric, not an engineering detail. It belongs on the same dashboard as reserved instance coverage and egress, and your Cloud Cost Calculator baseline should include it.

$
Free Tool
See What You're Actually Paying Across Providers
Use our Cloud Cost Calculator to compare real pricing across AWS, Azure, GCP, Backblaze, Wasabi and more, side by side, in seconds.
Try the Free Calculator  →

Self-Hosting: Where the KV Cache Actually Lives

Teams running open-weight models on their own GPUs or a neocloud face the memory problem directly. NVIDIA describes a four-tier hierarchy: GPU HBM, host DRAM, local NVMe, and shared network storage, with its new context memory tier slotted between local and shared storage. Each step away from the GPU adds capacity and latency.

The most detailed public test of an external KV tier is the Weka and Nebius benchmark published on StorageNewsletter on October 5, 2026. It replayed more than 5,000 real agentic coding sessions, with contexts approaching 900K tokens, against DeepSeek-V4-Pro on a single 8-GPU B300 node for eight hours per configuration. Running from HBM alone, the node recomputed 60 percent of all context it processed. With Weka's Augmented Memory Grid pooling NVMe across the cluster, recompute fell below 7 percent, output rose from 46K to 169K tokens per GPU-hour, and median time to first token fell from 5.7 seconds to 1.05 seconds.

Requests with first token in 5 seconds or less
HBM only
44%
With NVMe KV tier
97%
Weka and Nebius benchmark, DeepSeek-V4-Pro on 8x B300, 8-hour replay of real agentic sessions, published October 5, 2026. Vendor-run test.

Read the benchmark like a buyer

Weka sells the cache tier and Nebius sells the GPUs, so both benefit from these numbers. The baseline is HBM-only because, by the authors' account, no DRAM offload implementation supported DeepSeek V4 at the time of testing, which flatters the result against the most common cheaper alternative. NVIDIA's own claim of up to 5 times more tokens per second for STX is also a vendor figure. We found no independent benchmark yet. The direction is credible and the mechanism is sound; the multiplier you will see on your workload is unproven. Ask any provider for results on your own session traces before you pay for a context tier.


The Storage Bill Nobody Modeled

Context memory is a storage purchase. It just does not look like one, because it sits inside the inference stack rather than in the data lake. TrendForce (2026) projects enterprise SSD bit demand to grow more than 80 percent year over year in 2026 as cloud providers expand inference, and attributes part of that growth to agentic AI driving real-time retrieval and caching. Sunny Smith, founder and CTO of Massed Compute, told the DataStorage.com Podcast (Episode 7) that NVMe prices roughly tripled and that he expects scarcity to last until the end of 2027.

Two architecture rules follow. First, KV cache is disposable. It can always be recomputed, so it does not need the durability, replication and data protection of enterprise storage, a point Supermicro makes in its own BlueField-4 materials. Do not pay premium durable-storage rates for it. Second, it must sit next to the GPU. Context memory that lives in another region or another provider is useless at inference speed. This is data gravity at its sharpest: your context tier, like your training data, is landlocked to wherever your GPUs run.

For GPU buyers, that adds a vetting question to the list. After "do you own the GPU?", ask: "where does my KV cache go when HBM fills, and what am I charged for it?" A provider without an answer will hand you recompute at GPU-hour rates. Compare that line item across providers before signing, using live pricing in the GPU Price Explorer.

DataStorage.com Podcast
AI Infrastructure Is Changing Everything: Russ Artzt on GPUs, Neoclouds and the Future of Cloud
The CA Technologies co-founder explains why neoclouds exist, how GPU economics differ from CPU-era computing, and what that means for teams sizing AI infrastructure.
Listen to the Episode
The DataStorage.com Podcast / Episode 5

A Big Window Is Not a Well-Read Window

Paying to hold a million tokens assumes the model uses them well. The evidence says it often does not. Chroma's Context Rot study (2025) tested 18 frontier models and found that every one degraded as input length grew, often well before the window filled, and that semantically similar distractors made it worse. Chroma builds retrieval infrastructure and has a stake in that finding, but it matches the earlier Lost in the Middle research from Stanford (2023), which found models retrieve facts at the start and end of a long context far better than in the middle.

The infrastructure implication is uncomfortable: some of the context you are paying to store, cache and re-send is lowering answer quality. Bigger is not automatically better, and the cheapest token is the one you never send.


How to Decide When a Million Tokens Is Worth It

Use this sequence before you standardize on long context for any workload.

1. Measure your real context distribution

Log input tokens per request and report p50, p95 and the share of requests above 200K. Most teams find a long tail of a few sessions driving most of the spend.

2. Match the pricing shape to the distribution

If many requests cross 200K, flat-rate pricing on Claude 4.6 and later beats tiered pricing on Gemini 3.1 Pro for input. If requests are short and high volume, watch for the opposite cliff: Claude Haiku 5.5 charges five times more per input token once a prompt passes 100K.

3. Make caching a tracked KPI

Target a cache hit rate above 90 percent on long agent sessions, set cache lifetimes to match how people actually pause, and alert when hit rate drops.

4. Compact before you expand

Summarize or prune history at a fixed threshold, and retrieve documents on demand instead of preloading them. This cuts cost and, given the context rot evidence, may improve quality.

5. If you self-host, budget the context tier explicitly

Model HBM per session, decide whether you will recompute or offload, and price NVMe at 2026 rates rather than last year's.

Workload Typical context Strategy
Customer support chat Under 32K Short context, no long-context tier needed
RAG over a document library 32K to 128K Retrieve on demand, cache the system prompt
Agentic coding sessions 200K to 900K, growing per turn Prompt caching mandatory, compaction threshold, track hit rate
Whole-repository or contract-bundle analysis 500K to 1M, one shot Flat-rate long-context model or batch API
Self-hosted multi-tenant agents Hundreds of long sessions Budget an NVMe KV tier adjacent to the GPUs
Context ranges are planning guides, not limits. Measure your own p50 and p95 before choosing.

Key Takeaways

Five things to remember
  • A million tokens of context is roughly 328 GB of KV cache at FP16 for a 70B-class model, more than one GPU's HBM.
  • Long-context cost comes from re-sending history every turn: a 40-turn session ending at 830K tokens sends 17.6 million input tokens.
  • Anthropic bills the full 1M window at standard rates on Claude 4.6 and later; Gemini 3.1 Pro still doubles input above 200K.
  • Prompt caching cuts our modeled session from $72.00 to $9.10, but cache misses can more than double the cached cost.
  • KV cache tiers on NVMe cut recompute sharply in vendor tests, while enterprise SSD prices are still rising into 4Q26.

FAQ

How much GPU memory does a 1-million-token context window need?
For a 70B-class model based on the Llama 3.1 70B architecture, the KV cache for one 1M-token session is about 328 GB at FP16 and about 164 GB at FP8. That exceeds the HBM of a single current GPU, so long-context serving relies on multiple GPUs, cache offload, or recompute.
Is long-context pricing more expensive than standard pricing in 2026?
It depends on the provider. Anthropic bills Claude 4.6 and later models (except Haiku 5.5) at the same per-token rate across the full 1M window. Google charges Gemini 3.1 Pro $4.00 per million input tokens above 200K versus $2.00 below it. Claude Haiku 5.5 raises prices above 100K tokens.
Why do long-context AI agents cost so much more than single requests?
Because the API is stateless, every turn re-sends the full conversation history. Total input tokens grow roughly with the square of session length, so a session ending at 830K tokens of context can bill more than 17 million input tokens. Prompt caching is the main control.
What is a KV cache tier or context memory storage?
It is a storage layer, usually pooled NVMe flash on a fast network, that holds KV cache evicted from GPU memory so it can be reloaded instead of recomputed. NVIDIA's BlueField-4 STX context memory platform and Weka's Augmented Memory Grid are examples.
Does a bigger context window improve answer quality?
Not reliably. Chroma's 2025 Context Rot study found all 18 tested models degraded as input length grew, often well before the window was full. Retrieving relevant context and compacting history often beats preloading everything.
The window got bigger and the token got cheaper. The bill is decided by how many times you send the same context, and where you keep it in between.
Weekly Newsletter
Stay Ahead in Cloud Infrastructure
Join 1,200+ CTOs, architects, and cloud professionals who get our weekly briefing on storage strategy, GPU compute, and cloud cost intelligence.
Subscribe Free →

References

Share this article

🔍 Browse by categories

Free Cloud Cost Calculator

Compare AWS, Google Cloud, Azure, and alternatives like Backblaze B2 Discover how much you could save in seconds

🔥 Trending Articles

Newsletter

Stay Ahead in Cloud
& Data Infrastructure

Get early access to new tools, insights, and research shaping the next wave of cloud and storage innovation.