Tool · Last verified 2026-08-23

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.

Live calculator

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.

—input tokens per query
—of that is retrieved text
—cost per query, cheapest to dearest
—monthly at this volume
Cheapest model—
Dearest model—
One more chunk, per month—
ModelInput / 1MCost per queryPer 1,000 queriesMonthlyOne more chunkOverlap re-billed / mo
At the defaults: 6,400 retrieved tokens plus 450 instructions = 6,850 input tokens, 93.4% of it retrieved text, 400 output tokens. Seam you pay for twice: — of the retrieved block is repeated overlap, billed at full input rates. Linear in volume: cost scales straight with queries per day — there is no volume discount in the rate cards tracked here. Pricing data verified —
The retrieval premium

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.

ModelWithout retrievalWith 6,400 retrievedMultipleAdded per 1,000 queriesAdded per month
GPT-5.6 Sol
OpenAI · flagship (promo)
$0.00980$0.03543.61x$25.60$3,840.00
GPT-5.6 Terra
OpenAI · mid
$0.00570$0.01853.25x$12.80$1,920.00
GPT-5.6 Luna
OpenAI · budget
$0.00057$0.001853.25x$1.28$192.00
Claude Opus 5Dearest
Anthropic · flagship
$0.0123$0.04433.61x$32.00$4,800.00
Claude Sonnet 5
Anthropic · mid
$0.00490$0.01773.61x$12.80$1,920.00
Claude Haiku 4.5
Anthropic · budget
$0.00245$0.008853.61x$6.40$960.00
Gemini 3.6 Flash
Google · mid (promo rate)
$0.00184$0.006643.61x$4.80$720.00
Gemini 3.5 Flash-Lite
Google · budget
$0.00113$0.003052.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.

One dial, not two

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 sizeChunks retrievedRetrieved tokensCost per query (Sol)Monthly (Sol)
200326,400$0.0354$5,310.00
400166,400$0.0354$5,310.00
80086,400$0.0354$5,310.00
1,60046,400$0.0354$5,310.00
3,20026,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.

6,400 either way200 × 32 and 3,200 × 2 are the same invoice line.
top-4: $3,390.00 / moHalf the retrieved tokens, roughly two thirds the cost per query on GPT-5.6 Sol.
top-16: $9,150.00 / moDouble the context, 1.7x the cost — output is unchanged, so it never doubles.
93.4% is retrievedAt the defaults, only 450 of 6,850 input tokens are yours to write.
Top-k is the bill

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 retrievedRetrieved tokensInput per queryGPT-5.6 Sol / queryGPT-5.6 Sol / moClaude Opus 5 / mo
43,2003,650$0.0226$3,390.00$4,237.50
86,4006,850$0.0354$5,310.00$6,637.50
1612,80013,250$0.0610$9,150.00$11,437.50
2520,00020,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.

The seam

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.

OverlapRe-billed tokensShare of retrievedMonthly on GPT-5.6 Sol
0%00.0%$0.0000
5%2804.4%$168.00
10%5608.8%$336.00
20%1,12017.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.

560 tokens re-billed8 chunks of 800 at 10% overlap: 6,400 sent, 5,840 new.
$336.00 / mo on SolThe seam alone, at 5,000 queries a day.
$16.80 – $420.00The identical seam across the eight tracked models.
0% is freeNon-overlapping chunking removes the line entirely — at a recall cost only you can measure.
Boundaries

What this calculator does not price

Retrieval has costs on both sides of the query. This page prices one of them.

No embedding or indexing pricesEmbedding your corpus, re-embedding it after a model change and running a vector store are separate rate cards we do not track or verify. Budget them separately — indexing is one-off, retrieval is billed forever.
No rerankingA cross-encoder or LLM rerank pass over 50 candidates is a second model call with its own tokens. Add it with the API Cost Calculator.
No cachingA stable instruction prefix is exactly the shape prompt caching targets, and no cache discount is modelled here — so these figures are the uncached ceiling.
No retrieval qualityThis prices tokens, not answer quality. Cutting top-k from 25 to 4 cuts cost by roughly three quarters; whether answers survive is a measurement only you can make.
Your inputs, your shapeChunk size, top-k, overlap, instructions and answer length are all yours — we publish no defaults about how a RAG system should be built, only what each token costs.
Verified data onlyPer-1M rates come from official provider documentation, re-verified weekly — see how we verify and the pricing changelog.
FAQ

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.

Methodology

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.

Price any request shapeInput, output and volume into monthly spend: API Cost Calculator.
Loops and tool callsWhen each step re-sends the whole trajectory: Agent Loop Cost Calculator.
Chat re-sends historyThe same growth in a human conversation: Conversation Cost Growth Calculator.
Trim the prompt you sendRepeated instructions and markup: Prompt Weight Analyzer · HTML Token Savings.
How pricing worksPer-1M rates, two counters and the formula: How LLM Token Pricing Works.
The output premiumWhy the answer costs more per token: Input vs Output Tokens.
Documents into windowsHow much context you actually get: What Is a Context Window? · Can a 200-page PDF Fit?
Seven cost leversRanked by return, from model choice to re-sent history: How to Reduce LLM API Costs.
Provider rate cardsOpenAI · Claude · Gemini · all three.
Price directionIs token pricing going up or down? The eight-model basket index reads 87.1 against its 2026-08-09 baseline — down 12.9%, with both cuts scheduled to lapse: LLM Pricing Index.
A fourth providerDeepSeek prices input three ways — a cache-hit rate, a cache-miss rate and a peak/off-peak clock — at $0.30/$1.20 per 1M tokens on flash at peak, exactly half off-peak, with a 384,000-token output cap: DeepSeek API Pricing.
How we verifySources, weekly cadence and what our estimates exclude: Methodology · Pricing changelog.