A 1M-token context window is not a pricing tier, it is a multiplier. Long context API cost is decided per token, and the tokens you resend on every turn are the ones that reach the invoice: the same 400,000-token prompt costs a fraction of a cent on one catalogue model and about $1.55 on another at today's listed rates. This post works through that spread, the three rates behind it, and the point where summarising context beats paying for a bigger window. All figures are illustrative arithmetic on live catalogue prices, not a benchmark, and this is an AtmoRouter-authored post.
Context length is a ceiling, not a bill
context_length in GET /v1/models says how much a single request can carry, and max_output_tokens caps the reply. Neither field changes your rate: the model you point at does. The catalogue's largest windows sit at both ends of the price range:
| Model | Context | Max output | From input / output per Mtok | |---|---|---|---| | mm/MiniMax-M3 | 1,000,000 | 524,288 | $0.00075 / $0.003 | | zai/glm-5.3 | 1,000,000 | 128,000 | $0.0035 / $0.011 | | alicn/deepseek-v4.1-flash | 1,000,000 | 393,216 | $0.043125 / $0.1725 | | cc/claude-sonnet-5-5 | 1,000,000 | 128,000 | $0.35 / $1.75 | | ali/qwen3.8-max-0902 | 1,000,000 | 131,072 | $0.5 / $1.5 | | oai/gpt-6.1-terra | 1,050,000 | 128,000 | $0.7525 / $3.7625 | | oai/gpt-5.5 | 1,050,000 | 128,000 | $3.7625 / $22.575 |
Every row is a from price, meaning the lowest advertised offer in the most recent snapshot, not a rate promised for your request. A request settles at the offer actually selected, so a budget floor that excludes cheap tiers moves the real rate up. Rates refresh continuously, which is why the per-model page stays authoritative and a hardcoded price list goes stale.
The three rates behind one big request
A long prompt touches three prices, not one. Input covers every token you send, output covers every token generated, and cached input covers the repeated prefix the model already processed, billed at 10% of the input rate where caching is supported. The billing shape is:
textcost = ( (input_tokens - cached_tokens) * input_rate
+ cached_tokens * input_rate * 0.10
+ output_tokens * output_rate ) / 1,000,000Two practical footnotes. Dividing by a thousand instead of a million is the most common reconciliation bug in cost tooling. And a minimum request charge applies, so a long-context call that returns almost nothing is not free; failed requests, at least, are never billed.
Illustrative math: 400,000 tokens in, 2,000 out
Send one request with a 400,000-token document and a 2,000-token answer, no cache hits, and bill it at the from rates above:
| Model | Input cost | Output cost | Request total | |---|---|---|---| | mm/MiniMax-M3 | $0.00030 | $0.000006 | ~$0.0003 | | zai/glm-5.3 | $0.00140 | $0.000022 | ~$0.0014 | | alicn/deepseek-v4.1-flash | $0.01725 | $0.000345 | ~$0.018 | | cc/claude-sonnet-5-5 | $0.140 | $0.0035 | ~$0.14 | | ali/qwen3.8-max-0902 | $0.200 | $0.003 | ~$0.20 | | oai/gpt-6.1-terra | $0.301 | $0.0075 | ~$0.31 | | oai/gpt-5.5 | $1.505 | $0.045 | ~$1.55 |
Identical token counts, five thousand times apart on price. Two conclusions follow. If your workload is a one-shot read-and-answer over one big document, window size barely matters economically and you should optimise for answer quality. If your workload is an agent resending that document all afternoon, the model choice is the whole bill.
The second turn is cheaper, the twentieth is not
Caching only helps the part of the prompt that repeats. On cache-capable models the gateway reuses a repeated prefix on the second and later turns of the same conversation, and those tokens bill at 10% of input — but every new token you append each turn is billed in full, and output stays at full rate.
Assume a 380,000-token stable prefix, 5,000 new input tokens per turn, 1,500 output tokens per turn, and a cache hit on the prefix from turn two onward:
zai/glm-5.3: roughly $0.0014 for turn one, about $0.00017 per later turn, ~$0.0045 for twenty turns.oai/gpt-5.5: roughly $1.48 for turn one, about $0.196 per later turn, ~$5.20 for twenty turns.
Note what the cache does and does not buy. It discounts the prefix, not the growth, so a session that appends a large tool result every turn still climbs. And a hit is a property of the model and an exact prefix match, not a guarantee: change the system prompt, reorder tool definitions, or switch models and you are back to full input rate. Budget for misses.
Where compaction beats a bigger window
Compaction trades one expensive call for many cheap ones. Summarise the 380,000-token prefix down to 40,000 tokens once, then run the session on the summary. On oai/gpt-5.5, the summarisation call itself costs about $1.43 of input plus $0.18 of output (8,000 summary tokens), roughly $1.61. Over 200 turns, the summarised session lands near $15.30 including that call, against about $40.40 for the uncompacted one — around 62% less, at the cost of whatever detail the summary dropped.
The crossover depends on session length and on how much of the context is genuinely needed. Short sessions rarely justify compaction; long ones usually do. The alternatives sit on the same axis: retrieval over the corpus so only relevant chunks are sent, or map-reduce over chunks so no single request grows. Both cut input tokens, and both beat arguing about which 1M model is cheapest.
Measure the request before you resize it
Estimates are for planning; the usage block is for accounting. Non-streaming responses carry an X-Atmorouter-Cost header with the exact amount deducted, and the usage block reports input and output tokens, plus cached tokens where the model reports them, so you can recompute and compare:
pythonimport os
from openai import OpenAI
big_document = open("contract.txt", encoding="utf-8").read() # your long input
client = OpenAI(
base_url="https://atmorouter.dev/v1",
api_key=os.environ["ATMOROUTER_API_KEY"],
)
def request_cost(usage, input_rate, output_rate, cache_ratio=0.10):
details = getattr(usage, "prompt_tokens_details", None)
cached = getattr(details, "cached_tokens", 0) or 0
fresh = usage.prompt_tokens - cached
return (fresh * input_rate
+ cached * input_rate * cache_ratio
+ usage.completion_tokens * output_rate) / 1_000_000
resp = client.chat.completions.create(
model="zai/glm-5.3",
messages=[{"role": "user", "content": big_document}],
)
print(resp.usage)
print(request_cost(resp.usage, 0.0035, 0.011)) # rates from the model pageIf you stream, set stream_options={"include_usage": True} explicitly: usage frames are not guaranteed on every stream, and an interrupted stream may settle at a different number than the frames showed. Trust the settled usage log for reconciliation, not the visible text.
FAQ
Is a long prompt billed if the model ignores most of it?
Yes. Input is billed on tokens sent, not tokens the model used. Trimming context before the call is the only discount that applies to all models.
Does cached input make long context nearly free?
No. Cached tokens bill at 10% of the input rate, which is a real discount but not zero, and it only applies to a repeated prefix that actually hits the cache.
Should I default to the cheapest 1M-context model?
Not blindly. Check whether it supports caching, what its output rate is, and whether it is good enough for the task. An output-heavy workload on a cheap-input model can cost more than a balanced one.
Where do I check the current context window and rate for a model?
In GET https://atmorouter.dev/v1/models (context_length, max_output_tokens, pricing) or on the per-model page. Both refresh as offers change, so recompute budgets instead of copying the numbers in this post.
Next step
Pull live rates for the models you are considering from the AtmoRouter model catalogue, create a key on atmorouter.dev, and if your context is mostly repeated conversation, read the prompt caching guide before you redesign anything.