wzlxp.top builder tools

RAG calculator

Estimate RAG cost before your knowledge base scales.

Estimate retrieval-augmented generation cost from document chunks, embedding volume, retrieved context, model tokens, and monthly query volume. Start with OpenAI embedding and generation prices, then refine with production logs later.

Knowledge base shape

Average words per document is shown for planning context. The estimate uses chunk count and average tokens per chunk so you can match your real splitter settings.

Result
$72.59estimated monthly RAG cost
Per query<$0.01
Monthly queries15,000
Total chunks4,000
Annual$871
Embedding / index$0.03
Monthly indexing$0.03
LLM input / query<$0.01
LLM output / query<$0.01
Monthly query cost$72.56

Generation pricing checked 2026-05-09. GPT-5.4 mini: input $0.75/1M, output $4.5/1M tokens.

Embedding pricing checked 2026-05-10. text-embedding-3-small: input $0.02/1M tokens. Re-indexing: Monthly.

Cost insight: the largest cost driver is generated answers. Cutting answer tokens by 50% would save about $23.63 per month.

Estimated planning result only. Prices can change, and provider bills may include taxes, minimums, feature-specific charges, or usage adjustments. Verify production spend in the official provider dashboard.

How to use

How to use this calculator

  1. Describe your knowledge base

    Enter document count, chunks per document, average tokens per chunk, and how often the index is refreshed.

  2. Model each query

    Set retrieved chunks, prompt overhead, output tokens, and expected query volume so recurring generation cost is visible.

  3. Compare indexing and queries

    Review monthly indexing cost separately from monthly query cost before changing chunking, retrieval, or model choices.

RAG cost guide

A RAG bill has two different engines: indexing and answering.

A useful RAG estimate should not collapse everything into one token number. Indexing happens when content changes; query cost repeats every time users ask questions.

How the estimate works
Indexing tokens

Documents are converted into chunks, then chunk count is multiplied by average tokens per chunk to estimate embedding volume.

Embedding cost

Indexing tokens are multiplied by the selected embedding model price. The monthly version depends on whether you re-index never, monthly, weekly, or daily.

Query cost

Retrieved chunks become LLM input context, prompt overhead is added, output tokens are priced separately, and the result is multiplied by query volume.

Example workloads
Support knowledge base

A help center with moderate document count, monthly refreshes, and hundreds of daily customer questions.

Internal docs assistant

A larger private documentation corpus with frequent updates and higher retrieved context per answer.

Large help center

A high-traffic public support experience where query cost dominates after the first embedding pass.

Cost optimization tips
  • Reduce chunk count and chunk size before switching providers; retrieval context is often the repeating cost driver.
  • Retrieve fewer high-quality chunks instead of many noisy chunks that inflate every query.
  • Separate one-time indexing from recurring query cost when presenting a budget to a team.
  • Re-index only when content changes enough to justify the extra embedding cost.
Common mistakes
  • Counting only generation tokens and forgetting embedding cost.
  • Forgetting that retrieved chunks are added to LLM input on every query.
  • Treating one-time indexing as a monthly recurring cost.
  • Using average document size without checking very large outlier documents.

References and assumptions

Built for transparent RAG planning, not document upload.

OpenAI API pricing

The first version uses manually maintained OpenAI embedding prices and the site's shared OpenAI generation model prices. Exact provider bills can differ because of taxes, discounts, model changes, caching, retries, and provider-specific feature charges.

This page does not upload documents or call provider APIs. It estimates RAG cost from numeric workload assumptions so teams can compare chunking, retrieval depth, re-indexing frequency, and query volume before implementation.

FAQ

RAG cost calculator quick answers

What does the RAG cost calculator estimate?

It estimates indexing tokens, embedding cost, retrieved context tokens, generation input and output cost, per-query cost, monthly query cost, monthly re-indexing cost, and annual RAG spend.

Why is indexing cost separate from query cost?

Indexing and embedding usually happen when documents are added or refreshed, while query cost repeats every time a user asks a question. Keeping them separate makes scaling decisions clearer.

Does this calculator upload my documents?

No. It uses only numeric planning inputs in the browser. It does not upload documents, ask for API keys, or call provider APIs.

Which embedding prices are included in the first version?

The first version includes manually maintained OpenAI embedding options. Other provider-specific embedding prices can be added after the core RAG workflow is stable.