RAG Pipeline Cost Calculator

Break down monthly RAG costs into generation, search, storage, and embedding.

Estimated monthly RAG cost USD 715.00
LLM generation USD 600.00
Retrieval USD 5.00
Storage + embeddings USD 110.00
Inputs
Try:
Rates and amounts use this currency. No foreign-exchange conversion is applied.
queries / month
Number of production queries.
tokens / query
Includes retrieved context sent to the model.
tokens / query
Average generated tokens per query.
USD / 1M tokens
Model input price per million tokens.
USD / 1M tokens
Model output price per million tokens.
USD / month
Monthly vector database/storage charge.
USD / 1,000 queries
Search/query infrastructure cost.
USD / month
Recurring embedding and re-indexing cost.
Results & Graph
Estimated monthly RAG cost
USD 715.00
LLM generation
USD 600.00
Retrieval
USD 5.00
Storage + embeddings
USD 110.00

RAG pipeline monthly cost breakdown

Graph 1 • Retrieve then generate Domain-specific illustration generated from the active calculator inputs.
QuestionUser queryRetrieval4,000 ctx tokensGeneration500 out tokensMonthly totalUSD 715.00Vector storage and indexing are added to query-time costs
Graph 2 • Monthly components Components follow the units and rates entered above.
LLM 600 USD Retrieval 5 USD Storage 100 USD Embeddings 10 USD
Graph 3 • Total-cost curve Illustrates how output responds as the workload scales.
0USD 324USD 648USD LLM: 600 USD 600 LLM Retrieval: 5 USD 5 Retrieval Storage: 100 USD 100 Storage Embeddings: 10 USD 10 Embeddings
Summary: Estimated RAG stack cost is USD 715.00 per month.
Summary: At 50,000 queries/month, generation, retrieval, storage, and embedding assumptions total USD 715.00.
⚠️ Use measured token counts and provider rate cards. Vector infrastructure prices can include minimum commitments and network fees.
Interactive chart & math engine powered by CalculatorGraph

Formula: RAG Pipeline Cost Calculator

Monthly Total = Queries × (Input Tokens × Input Rate + Output Tokens × Output Rate) ÷ 1M + Retrieval + Storage + Embeddings
Monthly Total = Queries × (Input Tokens × Input Rate + Output Tokens × Output Rate) ÷ 1M + Retrieval + Storage + Embeddings
  • : Monthly queries
  • : Input and output tokens per query
  • : Retrieval, storage, and embedding charges

Worked example: 50,000 RAG queries each month

Estimate token generation plus entered search, storage, and embedding charges.

  1. Calculate per-query model input and output costs.
  2. Scale generation cost by query count.
  3. Add retrieval, vector storage, and embedding charges.
Result: Monthly total is the sum of model, retrieval, storage, and embedding costs.

Frequently Asked Questions

What counts as input tokens?

Include the user prompt, system instructions, conversation history, and retrieved passages sent to the model.

Why is generation such a large share of the bill?

Because each request is long. The default sends 4,000 input tokens and receives 500 back, and that happens 50,000 times a month. At 2 and 8 per million, each request costs 0.012 in model fees, so generation reaches $600.00 a month. Storage and embeddings are flat at $110.00 and retrieval is only $5.00, so they cannot keep pace with token spend.

Does the embedding cost go up with more queries?

Not in this calculator. The embedding box is a fixed monthly amount, 10 by default. If your pipeline embeds every incoming question with a paid model, that cost does rise with traffic, and you need to estimate it yourself at your query volume and include it in the embedding figure. Document embedding for an index that rarely changes is closer to fixed.

How do I model a pipeline that calls the model twice per question?

Add the tokens of both calls together. If a query rewrite step uses a few hundred tokens and the answer step uses 4,000 input and 500 output, enter the combined input and output per user question. Keep queries per month as the number of user questions. If the two calls use different models, the single pair of rates will need to be a weighted blend.

What is the cost with no traffic at all?

Setting monthly queries to zero leaves only the fixed charges. With the defaults that is $110.00: 100 for vector storage and 10 for embeddings. Generation and retrieval both drop to zero. This is a useful floor for a pilot or an internal tool with little usage, because it shows the cost of keeping the index available whether or not anyone asks a question.

Why does the cost per query fall as volume rises?

Only the fixed $110.00 is shared out. At 30,000 queries the all-in cost is $473.00, about 1.58 cents per answer. At 75,000 it is $1,017.50, about 1.36 cents. The variable part, 0.012 per request, does not change with volume, so the per-answer cost approaches that floor but cannot go below it on these rates.

Can I enter a negative or blank query count?

A negative number is rejected with a message that monthly queries must be zero or greater, and no total is shown. Zero is accepted and gives the fixed-cost floor. If you want to see a quieter month, enter the lower volume directly, such as the 30,000 preset, rather than trying to subtract from the default.

What happens to the total if I switch to a cheaper model?

Only the generation line changes, and it moves in proportion to the rates. With the defaults, halving both the input and output rates halves generation, so the $600.00 line becomes half that while retrieval stays at $5.00 and storage plus embeddings stays at $110.00 a month. Check the output quality of a cheaper model on your own questions before relying on the lower figure.

Does prompt caching reduce the result?

No. The formula charges every input token at the single input rate you enter. If your provider gives cheaper rates for cached prefixes, such as a repeated system prompt, estimate what share of input tokens is cached and work out a blended rate by hand. Enter that blended figure in the input rate box to get a closer estimate.

Which number should I change first to lower the bill?

On the defaults, input tokens per query. They drive two thirds of the $600.00 generation line, and reducing them usually means retrieving fewer or shorter passages, which costs nothing to try. Switching to a cheaper model also helps but can change answer quality. Storage and retrieval are too small here to make a real difference.

Is the 0.1 retrieval rate per query or per thousand?

Per thousand queries. The calculator divides monthly queries by 1,000 and multiplies by the rate, so 50,000 queries at 0.1 gives $5.00. If your vector service quotes a price per single query, multiply it by 1,000 before entering it, or the retrieval line will come out a thousand times too small.

Will the estimate hold if traffic is very uneven?

The total depends only on monthly sums, so busy days and quiet days average out as long as the token counts per request are realistic. Uneven traffic matters more for rate limits and capacity than for this bill. It can matter for cost if busy periods bring longer conversations, which would raise the average tokens per query.

Fifty thousand questions a month for $715 in total

Out of the box, this calculator describes a mid-sized retrieval-augmented assistant. It answers 50,000 questions a month. Each request sends 4,000 tokens to the model and gets 500 back. Input costs 2 per million tokens and output costs 8 per million. Vector storage is a flat 100 a month, retrieval costs 0.1 per 1,000 queries, and embedding work adds 10 a month.

Those inputs give an estimated monthly cost of $715.00 a month. Generation is $600.00 of it, retrieval is $5.00, and storage plus embeddings is $110.00 a month.

The split is the first thing worth noticing. On these assumptions the model calls are about 84% of the bill. The vector database, which often gets most of the attention when people design a RAG system, is a rounding error next to the tokens. That is common for pipelines that stuff several retrieved passages into each prompt.

It also tells you where to look if the number is too high. Cutting storage in half would save $50. Cutting the context sent to the model by a quarter would save twice that.

Per-query arithmetic behind the $600 generation line

Work out one request first. Input is 4,000 tokens at 2 per million, which is 0.008. Output is 500 tokens at 8 per million, which is 0.004. One answer costs 0.012 in model fees, a little over one cent.

Multiply by 50,000 queries and you get $600.00 a month. Two thirds of that is input and one third is output, even though output is four times more expensive per token. The input side wins because each request sends eight times as many tokens as it receives.

That ratio is typical of RAG. The question is short, but the system instructions, any conversation history and the retrieved chunks are all input. A pipeline that pulls five or six passages of several hundred tokens each reaches 4,000 tokens quickly.

Because input dominates, the input rate and input token count are the two levers with the most effect. Halving the input tokens, with everything else at the defaults, cut generation by a third. Halving both rates halved the generation line, to half of $600 a month.

Retrieval and the two fixed charges

Retrieval is billed per 1,000 queries. At 0.1 per thousand and 50,000 queries that is 50 thousands of queries times 0.1, or $5.00. Even if you raise the rate tenfold, to 1 per thousand, the line becomes $50, still small next to generation.

Vector storage and embeddings are entered as monthly amounts and do not change with query volume. The default 100 for storage and 10 for embeddings give the $110.00 line. Set queries to zero and the calculator returns exactly that, $110.00, which is the cost of keeping the index alive with nobody using it.

The embedding box is a monthly total, so it should cover whatever embedding work you actually do in a month: new documents, re-embedding after a chunking change, and, if your provider charges for it, embedding each incoming question. That last item scales with traffic. The calculator will not scale it for you, so estimate it at your query volume and add it to this box.

If you pay for a managed vector service with a minimum monthly commitment, enter the commitment, not the usage you expect. A minimum is the floor whether or not you reach it.

How volume changes the cost per answer

Only query volume moves between the presets. At 30,000 queries a month the total is $473.00, with $360.00 of generation and $3.00 of retrieval. At 75,000 it is $1,017.50, with $900.00 of generation and $7.50 of retrieval. The $110.00 of fixed charges stays the same in all three.

Divide each total by its volume to get an all-in cost per answer. It is about 1.58 cents at 30,000, about 1.43 cents at 50,000 and about 1.36 cents at 75,000 queries. The fixed charges are spread more thinly as volume grows, so each answer gets slightly cheaper.

The effect is modest because generation is variable and dominates. Unit cost will not fall much further with more traffic unless you change the token counts or the rates. If you are pricing a product per query, the variable 0.012 of model cost is the number you can never get below on these assumptions.

Growth projections are where this view helps. A plan to double traffic roughly doubles the bill, and only the small fixed part fails to grow.

Cutting the token bill without touching the model

Since input tokens drive most of the cost, the cheapest savings are usually in what you retrieve. Fewer chunks per request, shorter chunks, or a reranking step that keeps only the best passages all lower the input token count. Each 1,000 tokens removed per request is a quarter of the default input, which takes a sixth off the $600.00 generation line.

Trimming the system prompt helps in the same way, since it is sent with every request. So does limiting how much earlier conversation is carried forward in a chat interface.

Output tokens are harder to cut without hurting answers, but asking for concise responses still matters at the 8 per million default. Every 100 output tokens saved per request is a fifth of the output side.

Some providers discount repeated prompt prefixes through caching. The calculator does not model that, so if your provider offers it, the honest way to reflect it is to enter a blended input rate that you have worked out from your own usage.

Filling the token boxes from real logs

The token counts are the inputs most likely to be wrong, and they matter most. The default 4,000 input and 500 output tokens are a reasonable starting guess for a pipeline that retrieves a handful of passages, but your own pipeline may be quite different.

If you have a prototype running, take a sample of real requests and read the token usage your model provider reports for each one. Average the input and output counts separately. The average is what belongs in the boxes, because the calculator multiplies a single figure by the monthly volume.

Look at the spread as well as the average. If a small share of requests carry very long histories, the average can sit well above the typical request. That is fine for budgeting, since you pay for the long ones too, but it suggests where a cap on history length would save the most.

Without a prototype, build the input count from its parts: system prompt, typical question, the number of chunks retrieved times their size, and any history you plan to keep. Adding those up for the default design of five or six chunks gets close to the 4,000 default. Output is easier to guess from the length of answer you want, at roughly one token for every three quarters of a word.

Recheck the counts after any change to chunking or retrieval settings. A larger chunk size or a higher top-k raises the input side straight away, and the $600.00 generation line moves with it.

Traffic patterns the single average misses

Everything here is a monthly average. The calculator assumes every query has the same token counts, which real traffic rarely does. A few long conversations or very broad questions can pull the average up a long way, so base the token figures on logged requests rather than a hand estimate.

Retries are not counted unless you include them. If a request fails and is sent again, or if a guardrail check makes a second model call, each of those is another set of input and output tokens. Agent-style pipelines that call the model several times per user question need the token counts multiplied by the number of calls.

Engineering time, monitoring, data transfer, backups and support plans sit outside the formula, as the page's limitations note says. For a team budget, those can be larger than the $715 estimate itself.

The currency menu changes the symbol only. Rates and fixed charges must be entered in the currency you choose.

Checking a vendor quote against the $715 estimate

When a vendor or an internal team quotes a monthly figure for a RAG service, this calculator gives you a way to see what it implies. Enter the volume and token counts you expect, plug in the model rates from the quote, and compare.

If the quote is far above the estimate, ask what is included: hosting, a minimum commitment, support, or a margin on tokens. If it is far below, ask which assumptions differ, such as smaller context, a cheaper model or a cap on usage.

Run at least three volumes, like the presets do. A deal that looks fine at 50,000 queries might change shape at 75,000 if its pricing tiers or minimums are not linear, and the formula here is linear throughout.

The figure is an estimate for planning. Provider prices change, and the rates you type should come from the provider's current price list or your contract.