Calculator

Context window cost calculator

Compare the cost of large context packs—docs, chat history, or RAG chunks—against each model’s window. See utilization, full-window fill cost, and the cheapest models that still fit.

Context window

Pack fits the window

$842.24$0.0842 / req

Fits Gemini 2.5 Pro (1,000,000 ctx)

Utilization12.9%
Headroom871,200
Context + output128,800
Fill window once$0.5955

Pack

Context pack inputs

Pick a planning size or enter exact context tokens.

Fit meter

Window utilization

Fit/overflow gauge plus cost of stuffing the full window.

Fits12.9%
128,800 / 1,000,000

871,200 tokens of headroom remain for output and growth.

Input / cached / output$480.00 / $282.24 / $80.00
Fill whole window once$0.5955
Pack at volume$842.24
8K pack
8,000 · util 1%
$127.64
32K pack
32,000 · util 3%
$270.56
128K pack
128,000 · util 13%
$842.24
200K pack
200,000 · util 20%
$1,271.00
!
1M pack
1,000,000 · util 100%
$6,035.00

Cheapest models that fit this pack — GPT-5 nano ($26.88), GPT-5.4 nano ($26.88), Gemini 2.0 Flash-Lite ($48.00).

View cheapest fit: GPT-5 nano

Context packs are planning sizes (8K–1M). Some providers charge long- context premiums above a threshold—confirm official tiers. Updated 2026-07-31. Approximate static list prices for planning only. Always verify against each provider’s official pricing page before production budgeting.

Guide

How to get value from this calculator

Price workloads that use large context windows from 8K to 1M tokens and check whether your prompt fits available models. Long-context input is billed at standard or premium input rates on every request, so a 200K-token RAG pack dominates cost even if output is short. Find cheaper models that still fit your context needs.

Cost formula

Request cost = (context input tokens / 1M × input price) + (output tokens / 1M × output price); Models filtered where context input tokens ≤ model context limit

Why it matters

Context window marketing numbers invite stuffing full documents into prompts, but you pay input tokens for every byte on every call. Right-sizing context is often the fastest cost cut without changing models.

How to use it

  1. Enter total input tokens including system prompt, documents, and history.
  2. Set expected output tokens per request.
  3. Review which models fit your context size and their per-request cost.
  4. Check the fit/overflow gauge to see whether your prompt fits each candidate.
  5. Compare cost across models that meet your context floor.
  6. Test whether summarization or retrieval can shrink context below the next cheaper tier.
  7. Verify context limits and any long-context surcharges on provider pricing pages.

Planning tips

  • Retrieval beats full-document context for most RAG apps—pay for relevant chunks only.
  • Prompt caching reduces effective cost of large stable prefixes—combine with context planning.
  • Some models price long context at premium input rates above a threshold—check provider rules.
  • Output pricing is unchanged by context size—trim input before downgrading output quality.
  • If the gauge shows overflow, shrink context before paying for a larger-window tier.
  • Log actual context tokens used in production; developers often overestimate needed window.

Frequently asked questions

Do all tokens in the context window cost the same?

On most providers, all input tokens bill at the input rate unless cached at a discount. Some providers add long-context premiums above certain lengths.

Should I pick the model with the largest context window?

Only if you truly need it. Larger-context models are often more expensive per token. Fit context to the smallest capable model.

Are context limits and prices exact here?

CentsPerToken uses approximate list prices and published context limits for planning. Verify officially before architecting around a specific window size.

How does this relate to the RAG calculator?

The RAG calculator models indexing plus retrieval plus generation. This tool focuses on per-request context sizing and model fit.