RAG Cost Calculator
What retrieval-augmented question answering costs per question and per month, when every answer is built from retrieved passages.
Updated · By Niraj Kumar · 6 sources
https://checkpre.com/ai/rag-cost-calculator
Model
Each request
System prompt, conversation history, documents and tool definitions are all resent on every call.
The visible answer.
Count tokens from a prompt or JSON payloadShowHide
Plain text, OpenAI Chat or Responses JSON, or Anthropic Messages JSON. A final assistant message or a response body counts as output. Counted in your browser; nothing is uploaded.
Loading the tokenizer…
Counts use OpenAI's o200k tokenizer, so they are exact for GPT-6 and GPT-5 models, plus a few tokens of message framing. Other providers' tokenizers count the same text differently and do not publish a conversion factor; Anthropic says Claude models from 4.7 on produce about 30% more tokens than earlier Claude models. For an exact count on another model, paste one of its API responses: the usage it reports is shown above.
Thinking tokens are billed as output. Leave at 0 for models or settings that do not reason.
Volume
60,000 requests over 30 days.
Discounts
The share of input that repeats exactly at the start of every request, such as a fixed system prompt. The prompt caching calculator prices cache writes and expiry in detail.
- Per 1,000 requests
- $17.84
- Input
- $816.00
- Cached input
- $14.40
- Output
- $240.00
- Price rank
- 15th cheapest of 24
- Cheapest listed model
- Claude Haiku 5.5
- $53.52 a month, $1,017 less
- Input76%
- Cached input1%
- Output22%
- 1Claude Haiku 5.5Anthropic$53.52
- 2GPT-6 LunaOpenAI$53.52
- 3Qwen3.8 FlashAlibaba$83.28
- 4GPT-5.6 LunaOpenAI$111.84
- 5DeepSeek V4.1 FlashDeepSeek$151.63
- 6Gemini 3.5 Flash-LiteGoogle$184.56
- 7Qwen3.7 PlusAlibaba$204.48
- 8Gemini 3.8 FlashGoogle$401.40
- 9Claude Haiku 4.5Anthropic$535.20
- 10Grok 4.3xAI$584.40
- 11DeepSeek V4 ProDeepSeek$636.77
- 12Grok 4.7xAI$996.00
- 13Claude Sonnet 5.5Anthropic$1,063
- 14GPT-6.1 SolOpenAI$1,063
- 15Claude Sonnet 5Anthropic$1,070
- 16GPT-6 SolOpenAI$1,070
- 17Qwen3.8 MaxAlibaba$1,104
- 18GPT-5.6 TerraOpenAI$1,118
- 19Gemini 3.1 ProGoogle$1,118
- 20Claude Opus 5.5Anthropic$2,126
- 21GPT-5.6 SolOpenAI$2,141
- 22Claude Opus 5Anthropic$2,676
- 23Claude Fable 5.1Anthropic$5,298
- 24GPT-6 AstraOpenAI$5,352
How the RAG Cost Calculator works
cost = (fresh input × input rate + cached input × cache rate + (output + reasoning) × output rate) ÷ 1,000,000This page uses the same method as the LLM API Cost Calculator, which explains each term and assumption in full.
Worked example
2,000 questions a day, each answered from about 7,000 tokens of retrieved passages plus a 1,000-token instruction block. Retrieved passages change with every question, so only the instructions cache. Priced on Claude Sonnet 5.
- 1Each request: 8,000 input tokens (15% cached), 400 output
- 2Input costs $0.0138 and output $0.004, so $0.0178 a request
- 3× 60,000 requests over 30 days = $1,070
$1,070 a month on Claude Sonnet 5. The cheapest listed model, Claude Haiku 5.5, would cost $53.52.
Frequently asked questions
What drives the cost of a RAG pipeline?
Input. Each question sends the retrieved passages, often several thousand tokens, while the answer is a few hundred, so input can be 90% of the bill. Retrieving fewer, better chunks saves more than switching models. Embedding and vector database costs are separate and usually small next to generation.
Can RAG prompts be cached?
Only the part that repeats: the instructions and any fixed reference material placed before the retrieved passages. The passages differ per question, so they do not cache, which is why the preset assumes only about 15% of the input is cached. Order the prompt so stable content comes first.
Sources
- Anthropic, Claude API pricing · checked
- OpenAI, API pricing · checked
- Google, Gemini API pricing · checked
- DeepSeek, Models and pricing · checked
- xAI, Models and pricing · checked
- Alibaba Cloud Model Studio, Model pricing · checked
Related calculators
- LLM API Cost CalculatorPrice a real workload across Claude, GPT, Gemini, DeepSeek, Grok and Qwen side by side, with prompt caching, batch discounts and exact token counts.
- AI Chatbot Cost CalculatorWhat a customer support or assistant chatbot costs to run on Claude, GPT or Gemini per month, with the system prompt cached.
- LLM Summarization Cost CalculatorWhat it costs to summarize documents in bulk with Claude, GPT or Gemini, by document length, summary length and daily volume, on the batch API.
- Prompt Caching ROI CalculatorSee whether caching your system prompt or documents pays off: cache writes, reads, expiry and break-even for Claude, GPT and Gemini.
More in AI, Cloud & Developer
- AI Coding Agent Cost Calculator
- LLM Classification Cost Calculator
- Claude Sonnet 5 vs GPT-6 Sol API Cost
- Claude Sonnet 5 vs GPT-5.6 Terra API Cost
- Claude Sonnet 5 vs Gemini 3.1 Pro API Cost
- Claude Sonnet 5 vs Claude Opus 5.5 API Cost
- Claude Opus 5.5 vs GPT-6 Astra API Cost
- Claude Opus 5.5 vs GPT-5.6 Sol API Cost
- All 99 AI, Cloud & Developer calculators