CalcSays
CLAUDE HAIKU 4.5 · RAG COST

RAG Cost on Claude Haiku 4.5

Running RAG with Claude Haiku 4.5 as the generator? Embeddings barely register — generation over retrieved chunks is the real bill. This page also checks it against stuffing the whole corpus into a cached long context.

For engineers pricing a RAG pipeline — shows that generation, not embeddings, dominates the bill, and prices RAG against stuffing the whole corpus into a cached long context.

Model prices from OpenRouter · updated 2026-10-18

01 Your pipeline

Generation model
Embedding model

02 Generation vs embedding

Embeddings are <1% of this bill — generation dominates; optimize chunk count and model choice, not embedding price.

Generation
$360
2,000 retrieved + 100 question tok
Embedding
$0.20
query-time only

$360 generation + $0.20 embedding = $360/mo RAG total

03 RAG vs long-context

RAG (retrieve top-5)
$360
Long-context (whole corpus)
$110,156

RAG wins by $109,795/mo (100%)

Cost isn't the whole story. This page compares token cost only — retrieval quality, recall, and freshness are real reasons to use RAG even when long-context is cheaper on paper. Use this to know which one it is, not to decide blind.
📋 Full cost audit for this exact setup
Your current inputs, the cost decomposition, every savings lever ranked with its dollar impact, and the alternatives — computed instantly by the same tested engines behind this page. No email, nothing uploaded.

Generation prices from OpenRouter, snapshot 2026-10-18, synced daily. Embedding prices hand-verified (checked 2026-07-13), re-audited quarterly. RAG monthly = generation(retrieved+question→output, uncached) + queries×embedding. Long-context monthly = generation(corpus+question→output, cached at the given share). All math runs in your browser.

How the math works

A RAG bill has two parts: embedding the query and generating the answer over retrieved chunks. At this page's defaults — top-5 chunks of 400 tokens each (2K retrieved context) — embedding costs $0.20/month against generation's $360: embeddings are under 1% of the bill. Same baseline, one identity: generation $360 + embedding $0.20 = $360/month total.

Optimizing embedding price is optimizing the wrong line item — retrieved-chunk tokens riding into Claude Haiku 4.5 at $5/M output and $1/M input drive the bill. Fewer, better-targeted chunks (a smaller top-K, tighter chunking) cuts more cost than switching embedding providers ever will.

The other question this page answers: does RAG even save money over stuffing the whole 2.0M-token corpus into every query as a cached prefix? At these defaults, RAG wins — $109,795/month cheaper (100%) than long-context. This is a token-cost comparison only — retrieval quality and recall are separate, real reasons to use RAG regardless.

Prices sync daily from OpenRouter for the generation model; the embedding price is hand-verified against provider docs (embedding models aren't in the daily catalog). All math runs in your browser.

Frequently asked questions

How much does a RAG pipeline on Claude Haiku 4.5 cost per month?

At this page's defaults — 100,000 queries/month, top-5 retrieval — Claude Haiku 4.5 generation costs $360 and text-embedding-3-small query embedding costs $0.20: $360/month total. Tune every input above for your real pipeline.

Do embeddings actually matter for RAG cost?

Rarely much. At this workload embeddings are under 1% of the bill ($0.20 vs generation's $360). Query embedding is a few dozen tokens; generation processes thousands of retrieved tokens per call at rates 100–1000× the embedding price. Shop for embedding quality, not embedding price.

Is RAG cheaper than just using a long context window?

At this page's defaults, yes: RAG costs $360/month vs $110,156 for stuffing the full 2.0M-token corpus into every query (even with 50% caching) — $109,795/month saved (100%). The gap widens as the corpus grows relative to what you retrieve.

What retrieval size should I use?

This page defaults to top-5 chunks of ~400 tokens (2K total retrieved context). More chunks improve recall but scale generation cost linearly — the ranking of cost impact is retrieval size first, model choice second, embedding model a distant third.

What formula does this calculator use?

RAG monthly = generation(retrievedTokens + question → output, uncached) + queries × queryTokens × embedPrice. Long-context monthly = generation(corpusTokens + question → output, cached at the given share). Savings = longContext − RAG. All generation costs use the same engine as the LLM API Cost Calculator.

Are these prices current?

Generation prices sync daily from OpenRouter. Embedding prices are hand-verified against provider docs and re-audited quarterly (they aren't in the daily-synced catalog). All math runs client-side with tested code.