Workload cost scenario

RAG API Cost Calculator

Compare LLM API costs for retrieval-augmented generation with document context, grounded answers, and repeat traffic.

Teams estimating the generation portion of a RAG application.

Editable assumptions

Model the workload

Change the inputs to recalculate every compatible model.

Lowest tracked estimate
$43.20

Gemini 2.5 Flash-Lite for the current assumptions

Lowest cost does not mean best model. Test output quality, latency, retries, and reliability on your own workload.

Cost comparison

Estimated monthly cost by model

Comparing 22 models that fit the initial input length.

ModelProviderInput costOutput costMonthly estimateContext usage
Gemini 2.5 Flash-LiteGoogle$29.20$14.00$43.200.8%
DeepSeek V4 Flash non-thinkingDeepSeek$39.54$9.80$49.340.8%
GPT-4o miniOpenAI$51.00$21.00$72.006.3%
gpt-5.4-nanoOpenAI$58.40$43.75$102.152.0%
Gemini 3.5 Live Translate PreviewGoogle$73.00$52.50$125.506.1%
Gemini 3.1 Flash-LiteGoogle$73.00$52.50$125.500.8%
deepseek-v4-proDeepSeek$122.24$30.45$152.690.8%
Gemini 2.5 FlashGoogle$87.60$87.50$175.100.8%
Gemini 3 Flash PreviewGoogle$146.00$105.00$251.000.8%
gpt-5.4-miniOpenAI$219.00$157.50$376.502.0%
Claude Haiku 4.5Anthropic$292.00$175.00$467.004.0%
gpt-5.6-lunaOpenAI$292.00$210.00$502.000.8%
Gemini 2.5 ProGoogle$365.00$350.00$715.000.8%
Gemini 3.5 FlashGoogle$438.00$315.00$753.000.8%
Claude Sonnet 5Anthropic$584.00$350.00$934.000.8%
Gemini 3.1 Pro PreviewGoogle$584.00$420.00$1,004.000.8%
GPT-4oOpenAI$850.00$350.00$1,200.006.3%
gpt-5.6-terraOpenAI$730.00$525.00$1,255.000.8%
Claude Sonnet 4.6Anthropic$876.00$525.00$1,401.000.8%
Claude Opus 4.8Anthropic$1,460.00$875.00$2,335.000.8%
gpt-5.6-solOpenAI$1,460.00$1,050.00$2,510.000.8%
Claude Fable 5Anthropic$4,000.00$1,750.00$5,750.000.8%
Why this scenario matters

RAG question answering cost drivers

Retrieved passages often make input substantially larger than output, which changes the value of cached-input pricing and context trimming.

StackLens checklist

What to measure

  • Track average and p95 retrieved context separately.
  • Remove duplicate passages before generation.
  • Measure retrieval and embedding charges outside this LLM-only estimate.

Estimate boundary: The calculation covers tracked text-token rates only and does not include vector database, embedding, reranking, or storage charges.

View pricing sources

OpenAI model pricingHigh confidenceChecked 2026-07-13

Tracked prices for included OpenAI models are checked against official provider documentation.

Anthropic model pricingHigh confidenceChecked 2026-07-12

Tracked prices for included Anthropic models are checked against official provider documentation.

Google model pricingHigh confidenceChecked 2026-07-14

Tracked prices for included Google models are checked against official provider documentation.

DeepSeek model pricingHigh confidenceChecked 2026-07-12

Tracked prices for included DeepSeek models are checked against official provider documentation.

Anthropic model pricingHigh confidenceChecked 2026-07-14

Tracked prices for included Anthropic models are checked against official provider documentation.