RAG cost calculator

Four parts make up a RAG bill: embedding the documents once, embedding each question, generating the answer from the retrieved chunks, and the vector database. Enter your corpus and traffic; embedding prices come from our embedding table, generation prices from the model data, and the vector DB is whatever your provider charges you. Background: RAG API cost guide.

RAG cost calculator
ItemMonthly

Generation model ranking for this workload

Generation model ranking for this workload
ModelProvider MonthlyPer question

Per question = (query embedding + generation + vector DB) / questions per month. Models whose context is too small for the prompt are left out.

How the estimate works

Index cost = pages × tokens per page × embedding price, paid once and again only for changed documents. Each question embeds about 100 tokens and sends system prompt + k × chunk tokens + the question as input; the cache hit % applies to that input as in the main calculator. The vector DB field is a plain monthly amount: managed services bill by storage and reads, self-hosting by server time, so copy the number from your provider.

FAQ

Is the embedding cost really that small?

Usually yes: embedding prices are cents per million tokens, so even a large corpus costs a few dollars once. Re-embedding on every change, or embedding each question with a long prefix, is what makes it add up; generation stays the main cost in nearly every setup.

How do I lower the per-question cost?

Reduce retrieved input first: smaller chunks or a lower k, a shorter system prompt, and caching of the fixed prefix. Then pick a cheaper generation model from the ranking and test answer quality at each setting.