Home / Tools / RAG cost
RAG cost calculator
Estimate retrieval-augmented generation cost: corpus embedding, per-query retrieval pack, and LLM generation. See which line dominates your monthly bill.
Cost calculator · Embedding cost · Context window · Cache savings · RAG budgeting
OpenAI · input $0.400/1M · output $1.60/1M · cached $0.100/1M · rates checked 2026-08-12
Corpus indexing
Editable. Not from the LLM catalog. Default matches common small embed pricing.
0% = one-time index only. 10% amortizes a full re-embed every ~10 months into the monthly total.
Per query retrieval + answer
Retrieved context ≈ 2,560 tokens (chunk × k).
Applies published cached-input rates when the model supports them. Useful for a stable system prompt prefix.
- Input tokens / query
- 3,040
- Generation / query
- $0.001856
- Query embed / query
- $0.0000016
- Index once
- $0.04
- Generation / month
- $55.68
- Query embeds / month
- $0.048
- Index amortized / month
- $0.004
- Total / month
- $55.732 (100% generation)
| Line | Per query | Per month |
|---|---|---|
| Generation (LLM) | $0.001856 | $55.68 |
| Query embedding | $0.0000016 | $0.048 |
| Corpus embed (amortized) | n/a | $0.004 |
How to use this
- Pick the generation model you will call.
- Set corpus size and your real embedding $/1M from the embed provider.
- Set chunk size and top-k so retrieved tokens match production.
- Enter system, question, answer length, and monthly queries. Read which line dominates.
Open GPT-4.1 Mini in cost calculator · RAG cost guide · Reduce RAG costs · Context window fit
Related tools
Related guides
RAG cost calculator: estimate pipeline spend · RAG pipeline breakdown · Reduce RAG costs · Top-k and chunk cost · Embedding vs generation
Sources and references
Official documentation used for definitions, counting methods, or rate cards. Always confirm critical budgets on the provider page.
FAQ
- What are the cost components of a RAG system?
- Indexing (embed the corpus), tiny per-query embedding of the question, and generation (system + question + retrieved chunks + answer). Generation usually dominates.
- Why is generation more expensive than embedding?
- Embedding rates are often cents per million tokens and mostly one-time. Generation bills retrieved context as input on every query at LLM rates.
- How do I reduce RAG costs?
- Use a cheaper generation model when quality allows, lower top-k or chunk size, cache a stable system prompt, and cap answer length.
- Are embedding rates from the TokenCalculator catalog?
- No. Edit the embedding $/1M field yourself from your embed provider. Generation uses published catalog rates for the selected LLM.