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
- 5,000 documents of 1,200 tokens is 6,000,000 tokens; at $0.13 per million that is $0.78 to index once.
- Each query sends 5 chunks × 400 tokens plus a 500-token question = 2,500 input tokens, and returns 400 tokens.
- 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
AI Cost
OpenAI Cost Calculator
Estimate what running OpenAI models costs before the invoice arrives. Pick a model from the dropdown — the list is kept current and includes legacy tiers — then enter typical input and output token counts and your daily request volume for an instant per-request, per-day and monthly figure.
AI Cost
AI API Cost Calculator
Turn API traffic into a budget. Choose a model from any major provider — OpenAI, Anthropic, Google, xAI, Meta, Mistral, Cohere or Amazon Bedrock — then enter average tokens per call and expected daily calls to see the monthly bill.
AI Cost
AI Token Calculator
Convert words and characters into tokens, then straight into money. Useful for sizing a prompt, checking whether a document fits a context window, or pricing a batch job.
AI Cost
Claude Cost Calculator
Price Claude usage across Opus, Sonnet and Haiku. Enter typical prompt and response sizes with your daily volume to see which tier your workload can actually afford.
AI Cost
Gemini Cost Calculator
Work out Gemini API costs across the Pro and Flash tiers. Enter token counts and daily volume to see the monthly total, and compare tiers by switching the model.
AI Cost
LLM Cost Calculator
A provider-neutral calculator for any large language model. Pick a preset from OpenAI, Anthropic, Google, xAI, Meta, Mistral, Cohere or Amazon Bedrock, or enter your own input and output rates, to compare models on identical traffic.