RAG cost calculator
Estimate what a retrieval-augmented pipeline costs to run: one-time corpus embedding, per-query generation, and vector storage, broken down into a monthly total and a per-query price. Every number is editable, so it works for any embedding model, LLM, or vector database.
Corpus
Advanced
Queries
Vector storage
pgvector on a database you already run ≈ $0; managed vector databases typically land at $0–70/mo on entry tiers.
| Cost item | Basis | Cost |
|---|---|---|
| Embedding the corpus (one-time) | 500,000 tokens × $0.02/1M | $0.01 |
| Re-embedding / month | one-time only — no refresh | $0.00 |
| Generation input / month | 2,300 tokens/query × 9,000 queries | $62.10 |
| Generation output / month | 400 tokens/query × 9,000 queries | $54.00 |
| Vector storage / month | flat monthly rate | $0.00 |
| Total / month | excludes the one-time embedding row | $116.10 |
≈ $0.01 per query
Defaults reflect list prices as of July 2026 — every field is editable, so plug in any provider's pricing. Months are counted as 30 days.
Where RAG spend actually goes
A RAG pipeline has three cost buckets. First, embedding: every document is chunked and run through an embedding model once, billed per token. Second, generation: every query sends the user's question plus the retrieved context chunks to an LLM as input tokens and pays for the answer as output tokens. Third, storage: the vectors have to live somewhere, which is a flat monthly cost — near zero if you use pgvector on a database you already run, an entry-tier subscription if you use a managed vector database.
The counterintuitive part is which bucket dominates. Embedding looks scary because it scales with corpus size, but embedding models cost cents per million tokens — a thousand-page corpus embeds for under a dime. At any real query volume, the retrieved-context input tokens dwarf everything else: each query re-sends thousands of context tokens to a generation model priced a hundred times higher per token than the embedder. That makes chunk size and top-k your main cost levers — retrieving fewer, tighter chunks cuts input tokens directly, but starves the model of context and degrades answers, so tune them against answer quality, not just the bill. For a plain per-request comparison across generation models, see the LLM API cost calculator.
More free tools
- LLM price comparison — Live table of every model's API prices — sort, filter, and cost out your own request size.
- LLM cost calculator — Estimate per-request, daily, and monthly spend from token counts and request volume.
- RAG chunking visualizer — Paste a document and watch chunk size, overlap, and strategy change the chunks before you embed.
- LLM context window comparison — Count the tokens in any text and check which models it fits, against live context windows.
- Tool call & MCP schema builder — Build function-calling parameters once, copy valid JSON Schema for OpenAI, Anthropic, and MCP.
- AI chatbot ROI calculator — Turn ticket volume, handle time, and deflection rate into monthly support savings and ROI.