RAG Cost Calculator

Retrieval-augmented generation has two bills: a one-off cost to embed your corpus, and a per-query cost for the retrieved chunks you paste into the prompt. This calculator shows both.

Inputs

Result

$619

per month

$0.7800 one-off indexing · $0.0103 per query

Corpus tokens
6,000,000
One-off embedding cost
$0.7800
Retrieved context per query
2,000 tokens
Input tokens per query
2,500
Cost per query
$0.0103
Cost per 1,000 queries
$10.32
Cost per day
$20.63
Cost per month (30 days)
$619
First month incl. indexing
$620

Disclaimer: Model availability, pricing and specifications may change. Verify pricing directly with the provider before making business decisions. Preset rates reflect published list prices last reviewed August 2026; choose “Custom pricing” to enter your own rates.

Formula

  • Indexing = (documents × tokens per document ÷ 1,000,000) × embedding price
  • Query input = retrieved chunks × tokens per chunk + question and system prompt
  • Query cost = query input × input rate + answer tokens × output rate + question embedding

Methodology

Embedding the corpus is a one-time cost you pay again only when documents change, and embedding rates are one to two orders of magnitude cheaper than generation. For most apps indexing is a rounding error next to the ongoing query bill.

The recurring cost is dominated by retrieved context. Five 400-token chunks add 2,000 input tokens to every single query, which usually outweighs the user's question by an order of magnitude.

Vector database hosting is not included here because it is priced per index or per hour rather than per token. Add it as a fixed monthly line item alongside this estimate.

Example: a 5,000-document knowledge base

  1. 5,000 documents of 1,200 tokens is 6,000,000 tokens; at $0.13 per million that is $0.78 to index once.
  2. Each query sends 5 chunks × 400 tokens plus a 500-token question = 2,500 input tokens, and returns 400 tokens.
  3. At $2.50 / $10.00 per million that is about $0.0103 per query, roughly $20.60 a day at 2,000 queries, or about $618 a month.

Frequently asked questions

Is embedding or generation the bigger cost?

Generation, by a wide margin, for anything with steady traffic. Embedding is a one-off charge at a much lower rate; generation is paid on every query forever.

How many chunks should I retrieve?

Start at three to five. Each extra chunk adds its full token count to every query, and beyond a handful of chunks answer quality usually stops improving while cost keeps rising.

Do I have to re-embed everything when documents change?

No, only the changed documents. Budget re-indexing as a fraction of the initial cost based on how much of the corpus turns over each month.

Does this include the vector database?

It does not. Hosted vector stores charge per index, per stored vector or per hour, so add that as a fixed monthly cost on top of the token figures here.

Are these prices always up to date?

The presets reflect widely published list prices and are reviewed periodically, but providers adjust them and offer discounts for batch processing, cached input and committed spend. Model availability, pricing and specifications may change. Verify pricing directly with the provider before making business decisions.

What happens when a provider launches a new model?

Model names and rates live in one central configuration, so a new model appears in every relevant dropdown as soon as it is added. Page URLs stay provider-based rather than version-based, so no link ever goes stale when a model generation changes.

Does the calculator send my data anywhere?

No. Every calculation runs in your browser, so nothing you type is uploaded, stored or logged.

Related AI calculators