Skip to content
Free tool · No signup

RAG Cost Calculator

What your retrieval pipeline costs per query and per month, split across embedding, storage and generation, and how that compares to just using a long context window.

Usually the biggest lever in the whole system.

Questions answered, not chunks fetched.

About 1,300 per page of English text.

$
$

Routing tier. Caches only prefixes of 4,096 tokens or more. List price checked 30 Sep 2026 on Anthropic's pricing page.

Multiplies with top-k on every query.

%
%

Re-embedded each month.

$

List prices checked 30 Sep 2026.

$

Varies most between vector databases; take it from your provider's pricing page. Managed plans often add a monthly minimum on top.

Monthly
$1,146
$0.011 per query · 25.0K vectors
9.7K tokens sent to the model per query
0.2% is fixed cost that bills whether or not anyone asks a question.
Plus $0.231 once, to embed the corpus.
vs putting the whole corpus in the prompt

Your corpus is 10.0M tokens. That does not fit in a 1.0M-token context window, so sending it with every query is not an option. Retrieval is the only way to use it.

Where the money goes

RAG has separate cost centres, and only generation and reranking scale with traffic. Embedding and storage bill the same on a quiet month.

generation$1,144 · 99.8%
storage$1.75 · 0.2%
embedding$0.012 · 0.0%

What each change is worth

Each figure is this model re-run with that one input changed. They are not additive.

  1. Retrieve 5 chunks instead of 20saves $692.16/mo

    The single biggest lever in most RAG systems, and it usually improves answers rather than harming them: the relevant passage stops competing with near-misses.

  2. Halve the answer lengthsaves $87.50/mo

    Output bills at five to eight times input on current models, so answer length is a pricing decision.

  3. Halve the chunk overlapsaves $61.44/mo

    Overlap duplicates source tokens into multiple vectors, so it inflates embedding and storage together.

What actually moves a RAG bill

Three things decide it, and only the first is obvious.

Top-k times chunk size

These two numbers multiply on every query and set almost all of your generation cost. Most systems retrieve several times more than the answer needs.

Storage is a floor

Vector storage bills the same on a quiet month as a busy one. It is small for most corpora, but it is the part that does not go away when traffic does.

Reranking bills per search

Not per document. A candidate set over 100 documents costs more than one search, and chunks over ~500 tokens are split so each piece counts separately.

The full write-up is in RAG cost optimization. If your retrieval feeds an agent, the compounding cost of the loop around it is in AI agent costs.

RAG cost FAQ

Why do other RAG cost calculators give a much lower number?+

Because most of them price only embedding and vector storage. Generation is usually most of what a RAG pipeline costs to run each month, often over 90% at production query volumes, and a calculator that leaves it out will understate your bill many times over. This one prices all three cost centres, plus reranking, and shows the split so you can see which one to attack.

How much does a RAG pipeline cost to run?+

It depends far more on top-k and chunk size than on corpus size. Generation usually dominates, because every query sends top-k chunks through the model, so retrieving twenty 512-token chunks means about 10,000 input tokens per question before the system prompt. Embedding and vector storage are typically small by comparison, but they are fixed: they bill the same whether you serve one query or a million.

What is the biggest cost driver in RAG?+

Top-k, multiplied by chunk size. Those two numbers set the input tokens on every single query, so halving either roughly halves generation cost. Most systems retrieve far more than the answer needs, and cutting from twenty chunks to five is usually the single largest saving available. It often improves answer quality too, because the relevant passage stops competing with fifteen near-misses.

Is RAG cheaper than putting everything in a long context window?+

Per query, almost always, and often by one to three orders of magnitude, because retrieval sends a few thousand tokens where long context sends the entire corpus. Published measurements put retrieval around three orders of magnitude cheaper. Prompt caching narrows the gap substantially for a stable corpus, since the stuffed context becomes a cacheable prefix billed at roughly a tenth of input price. This calculator shows both numbers.

How much does embedding a corpus cost?+

Usually far less than teams expect, and it is mostly a one-off. Embedding models cost a small fraction of generation models per million tokens, so a corpus of ten million tokens costs about $0.23 to embed once with text-embedding-3-small, or about $1.50 with text-embedding-3-large. What recurs is churn: the share of documents that change each month and must be re-embedded. Chunk overlap raises both, because overlapping text is embedded more than once.

How is reranking priced?+

Per search rather than per document, where a search is one query plus up to about 100 documents. Two things inflate it unexpectedly. A candidate set above 100 documents counts as more than one search. And chunks longer than roughly 500 tokens are automatically split, with each piece counted as its own document, so raising chunk size can silently double the rerank bill without changing anything else.

Does a smaller chunk size reduce RAG cost?+

It reduces the tokens sent per retrieved chunk, so at a fixed top-k it lowers generation cost proportionally. But it also produces more chunks, which raises vector count and storage, and it can force a higher top-k to recover the same context, cancelling the saving. The useful target is tokens sent per query, which is top-k multiplied by chunk size, rather than either number alone.

Free consultation

Retrieval that answers well and bills quietly

The calculator shows the shape. We build the chunking, retrieval and caching decisions behind it. Book a free cost review.

Book a Free 30-Minute Call

We map one workflow that eats your team’s week and show you what an engineer and a few AI agents could take off it. No slide deck, no sales pitch. Just a working session.

Don’t want a call? Email [email protected]

Book a free call
  • One workflow mapped with you, live
  • A clear first step for your team
  • Reply within one working day

We worked with Seif on the React Native app for our vehicle-appraisal platform. What stood out most was how much ownership he takes: he thinks a feature through, raises edge cases before they turn into bugs, and delivers something that actually works. And then there is one more thing why I wanted to work with Seif after our very first call: Exceptional clear and consistent communication. It is a pleasure to work with him and his team!

Michael EmaschowFounder, RepairCheck
Teams we’ve built for
  • RepairCheck
  • Locus Digital
  • MasterPilot
  • Tabeebi
  • Sure-Bid
  • Hengcheng
Seif SgayerFounder ·View LinkedIn

Free Strategy Call

30 minutes · Google Meet · Free

No packages, no sales pitch. You leave with a clear first step.

By sending you agree to the privacy policy.

  • 30 min
  • Google Meet
  • Calendly
  • No commitment
  • The plan is yours to keep
  • Built for teams at Tabeebi, RepairCheck and MasterPilot