World of the Developers
All calculators

RAG Cost Calculator

Estimate the full monthly cost of a retrieval-augmented generation pipeline — indexing, retrieval, and generation.

Indexing

Query & generation

Estimated monthly cost

$74.38/month

One-time indexing

$0.30

Query embedding / mo

$0.015

Generation / mo

$74.06

Retrieved context: 1,500 tokens + 50 query tokens = 1,550 input tokens per query to GPT-5.1. Vector database hosting/storage cost is not included — add your provider's hosting fee separately.

How this is calculated

total = one-time indexing cost + (query embedding cost × queries) + LLM generation cost, where generation input tokens = retrieved chunks × average chunk size + query tokens.

Pricing is verified against provider pricing pages as of 2026-09-01. AI and cloud pricing changes frequently — confirm the current rate on the provider's own pricing page before budgeting.

Frequently asked questions

What costs make up a RAG pipeline?

Three separate costs: a one-time (or periodic) indexing cost to embed your corpus, a small per-query embedding cost for the user's question, and the LLM generation cost for producing an answer from the retrieved context — plus vector database hosting, which isn't token-based and is estimated separately.

Why does retrieved context dominate the generation cost?

Each retrieved chunk gets added to the LLM's input — retrieving 5 chunks of 300 tokens each adds 1,500 input tokens per query, on top of the user's question, often making retrieved context the largest single cost driver in a RAG system.

How can I reduce RAG costs without hurting answer quality?

Reduce chunk size or the number of chunks retrieved, use a cheaper model for generation, cache repeated system-prompt instructions, and re-index only when your corpus actually changes rather than on a fixed schedule.

Does this include vector database hosting costs?

No — vector database storage and query costs vary widely by provider (managed service vs. self-hosted) and aren't token-based, so add your vector DB's hosting fee on top of this estimate.