RAG Context Cost Calculator
Short answer: retrieval is an input-token tax you pay on every single query. At 800-token chunks with top-8 retrieval and a 450-token instruction block, one query sends 6,850 input tokens — 15.2x a bare prompt. Because the answer does not grow, the bill rises by far less: $0.00185 – $0.0443 per query, or $277.50 – $6,637.50 a month at 5,000 queries a day. Enter your own chunk size, top-k and volume below.
Price your retrieval shape
Six inputs: how big a chunk is, how many you retrieve, how much of each is repeated seam, the instruction block you always send, the answer length and your daily query volume.
| Model | Input / 1M | Cost per query | Per 1,000 queries | Monthly | One more chunk | Overlap re-billed / mo |
|---|
What retrieval adds to one query
The same 450-token instruction block and 400-token answer, priced with and without 6,400 retrieved tokens — at 5,000 queries a day, 150,000 a month.
| Model | Without retrieval | With 6,400 retrieved | Multiple | Added per 1,000 queries | Added per month |
|---|---|---|---|---|---|
GPT-5.6 Sol OpenAI · flagship (promo) | $0.00980 | $0.0354 | 3.61x | $25.60 | $3,840.00 |
GPT-5.6 Terra OpenAI · mid | $0.00570 | $0.0185 | 3.25x | $12.80 | $1,920.00 |
GPT-5.6 Luna OpenAI · budget | $0.00057 | $0.00185 | 3.25x | $1.28 | $192.00 |
Claude Opus 5Dearest Anthropic · flagship | $0.0123 | $0.0443 | 3.61x | $32.00 | $4,800.00 |
Claude Sonnet 5 Anthropic · mid | $0.00490 | $0.0177 | 3.61x | $12.80 | $1,920.00 |
Claude Haiku 4.5 Anthropic · budget | $0.00245 | $0.00885 | 3.61x | $6.40 | $960.00 |
Gemini 3.6 Flash Google · mid (promo rate) | $0.00184 | $0.00664 | 3.61x | $4.80 | $720.00 |
Gemini 3.5 Flash-Lite Google · budget | $0.00113 | $0.00305 | 2.69x | $1.92 | $288.00 |
Per 1,000 queries the same retrieved request costs $35.40 on GPT-5.6 Sol, $18.50 on GPT-5.6 Terra, $1.85 on GPT-5.6 Luna, $44.25 on Claude Opus 5, $17.70 on Claude Sonnet 5, $8.85 on Claude Haiku 4.5, $6.64 on Gemini 3.6 Flash and $3.06 on Gemini 3.5 Flash-Lite.
Input tokens go from 450 to 6,850 — 15.2x. Cost goes up only 2.7x to 3.6x, because the 400-token answer is identical in both columns and output is the expensive half of every request. The multiple is highest where input is cheap relative to output. Model choice still dominates the absolute number: the same retrieved query is $0.00185 on GPT-5.6 Luna and $0.0443 on Claude Opus 5, a 23.9x spread that dwarfs the retrieval premium itself. See Input vs Output Tokens for why the answer costs more per token than the context you feed it.
Chunk size and top-k are the same number
Retrieved tokens are chunk size multiplied by the number of chunks you retrieve. Providers bill the product, never the split. Every row below sends exactly 6,400 retrieved tokens, so every row costs exactly the same.
| Chunk size | Chunks retrieved | Retrieved tokens | Cost per query (Sol) | Monthly (Sol) |
|---|---|---|---|---|
| 200 | 32 | 6,400 | $0.0354 | $5,310.00 |
| 400 | 16 | 6,400 | $0.0354 | $5,310.00 |
| 800 | 8 | 6,400 | $0.0354 | $5,310.00 |
| 1,600 | 4 | 6,400 | $0.0354 | $5,310.00 |
| 3,200 | 2 | 6,400 | $0.0354 | $5,310.00 |
That is the useful part: chunk size is a retrieval-quality decision, not a cost decision. Tune it for recall and for how much surrounding context a passage needs to make sense, then control cost with the one number that matters — how many retrieved tokens you are willing to send.
What does change the bill is the total. Moving from top-8 to top-16 doubles retrieved tokens to 12,800 and takes GPT-5.6 Sol from $5,310.00 to $9,150.00 a month; top-4 halves it to $3,390.00. The cheapest RAG optimisation is almost never a better chunker — it is a smaller k.
What each chunk really costs
Same 800-token chunks, same 450-token instruction block, same 400-token answer — only the number of chunks changes. Monthly figures are 5,000 queries a day.
| Chunks retrieved | Retrieved tokens | Input per query | GPT-5.6 Sol / query | GPT-5.6 Sol / mo | Claude Opus 5 / mo |
|---|---|---|---|---|---|
| 4 | 3,200 | 3,650 | $0.0226 | $3,390.00 | $4,237.50 |
| 8 | 6,400 | 6,850 | $0.0354 | $5,310.00 | $6,637.50 |
| 16 | 12,800 | 13,250 | $0.0610 | $9,150.00 | $11,437.50 |
| 25 | 20,000 | 20,450 | $0.0898 | $13,470.00 | $16,837.50 |
A single extra 800-token chunk costs $0.00320 per query on GPT-5.6 Sol, $0.00400 on Claude Opus 5, $0.00160 on Claude Sonnet 5, $0.00080 on Claude Haiku 4.5, $0.00060 on Gemini 3.6 Flash, $0.00024 on Gemini 3.5 Flash-Lite and $0.00016 on GPT-5.6 Luna — $24.00 – $600.00 a month across the eight models at this volume. Widening top-8 to top-10 adds two chunks: $960.00 a month on GPT-5.6 Sol, $1,200.00 on Claude Opus 5 and $48.00 on GPT-5.6 Luna at 5,000 queries a day. Every one of those figures is linear in volume — 500 queries a day costs a tenth as much.
Overlap is billed twice
Chunkers usually repeat a slice of the previous chunk so no answer is split across a boundary. Useful for recall, invisible on the invoice — until you price it. Repeated tokens are duplicated tokens: they are sent, they are counted and they are billed at full input rates.
With 8 chunks of 800 tokens at 10% overlap, you send 6,400 retrieved tokens but only 5,840 are new. The 560-token seam is 8.8% of the retrieved block and 8.2% of the whole request — and it costs $336.00 a month on GPT-5.6 Sol at 5,000 queries a day.
| Overlap | Re-billed tokens | Share of retrieved | Monthly on GPT-5.6 Sol |
|---|---|---|---|
| 0% | 0 | 0.0% | $0.0000 |
| 5% | 280 | 4.4% | $168.00 |
| 10% | 560 | 8.8% | $336.00 |
| 20% | 1,120 | 17.5% | $672.00 |
Across the eight tracked models the same 560-token seam costs between $16.80 and $420.00 a month at this volume. Overlap is a real quality tool — just size it deliberately, because unlike chunk size it has a price tag attached.
What this calculator does not price
Retrieval has costs on both sides of the query. This page prices one of them.
RAG cost questions
How much does retrieval add to the cost of a query?
It multiplies input tokens, not output tokens. At the defaults on this page — 800-token chunks, top-8 retrieval, a 450-token instruction block and a 400-token answer — retrieval takes a query from 450 to 6,850 input tokens, 15.2x. Because the answer and therefore the output bill is unchanged, the total cost rises by only 2.7x to 3.6x depending on model.
Is a smaller chunk size cheaper?
No. Providers bill the tokens you send, and retrieved tokens are chunk size multiplied by the number of chunks retrieved. 200 x 32, 400 x 16, 800 x 8, 1,600 x 4 and 3,200 x 2 all send exactly 6,400 retrieved tokens and cost exactly the same: $0.0354 per query on GPT-5.6 Sol, $5,310.00 a month at 5,000 queries a day. Chunk size is a retrieval-quality decision, not a cost decision.
What does one more retrieved chunk cost?
One 800-token chunk costs $0.00320 per query on GPT-5.6 Sol, $0.00160 on Claude Sonnet 5 and $0.00016 on GPT-5.6 Luna. At 5,000 queries a day that is $960.00, $480.00 and $48.00 a month respectively. Going from top-8 to top-10 adds two chunks: $960.00 a month on GPT-5.6 Sol and $1,200.00 on Claude Opus 5.
Does chunk overlap cost extra?
Yes. Overlapping text is sent twice and billed twice. With 8 chunks of 800 tokens at 10% overlap you send 6,400 retrieved tokens but only 5,840 are new — 560 tokens, or 8.8% of the retrieved block, are re-billed seam. On GPT-5.6 Sol at 5,000 queries a day that seam costs $336.00 a month; across the eight tracked models the same seam costs $16.80 to $420.00.
Do you price embeddings or indexing?
No. We publish no embedding, ingestion or indexing prices — those are separate rate cards we do not track and verify. This calculator prices query-time tokens only: the instruction block, the retrieved passages and the generated answer. Budget embedding and re-indexing separately, and remember that indexing is a one-off cost while retrieval is billed on every single query.
Does this page upload my retrieval parameters?
No. Chunk size, top-k, overlap, volume and answer length stay in this browser tab. There is no form, no account, no API call and no storage — the arithmetic runs against the same published per-1M rates the rest of the site uses.
Where these numbers come from.
Retrieved tokens are your chunk size multiplied by the number of chunks retrieved. Duplicated overlap tokens are chunk size × overlap % × (chunks − 1), because each chunk after the first repeats one seam. Input tokens per query are retrieved tokens plus your instruction block; cost per query is input tokens ÷ 1,000,000 × the input rate plus answer tokens ÷ 1,000,000 × the output rate; monthly is cost per query × queries per day × 30. OpenAI prompts above 272,000 input tokens use the higher long-context rates, flagged in the table. Token rates are re-verified weekly against official provider documentation: OpenAI 2026-08-23, Anthropic and Google 2026-08-09 to 2026-08-16. Embedding, indexing, reranking, caching, batch, taxes and vector-store costs are excluded throughout.
Official sources: OpenAI model docs, Anthropic pricing, Google Gemini API pricing.