All guides
Choosing a model

The Cheapest LLM for RAG and Document Q&A

RAG requests are input-heavy, so input price and top-k decide the bill. Priced across models with caching, long context and embeddings costs included.

For RAG, the cheapest model that clears your quality bar is almost always a small one. Claude Haiku 5.5 and GPT-6 Luna both cost $0.56 per 1,000 typical RAG requests, which is 10× less than GPT-6.1 Terra, the cheapest mid-tier model that scores 165 or more on the Epoch Capabilities Index (ECI). The levers that move the bill after that are, in order, how many chunks you retrieve, whether your prompt prefix is cached, and which model you pick. Embeddings, which most teams worry about, are a rounding error.

Prices are per 1 million tokens, as of November 25, 2026, from the data on this site. Every cost below is computed as (uncached input × input price + cached input × cache price + output × output price) / 1,000,000 per request, then scaled to 1,000 requests. Prices move, so check /cheapest before you commit.

The shape of a RAG request

The cost model starts from what you actually send. We use this request throughout:

  • 1,500 tokens of stable instructions: system prompt, answer format, citation rules, a few examples.
  • 50 tokens for the user's question.
  • k retrieved chunks of 500 tokens each. At the default k = 5 that is 2,500 tokens.
  • 300 output tokens, a short grounded answer with citations.

At k = 5 the input is 4,050 tokens against 300 out. Input is still the larger part of the bill but not an overwhelming one: it is 73% of the cost on Haiku 5.5, because every model in this tier charges 5× as much for output as for input. If your answers run long or your model reasons before answering, output share rises. Input vs Output Token Pricing explains that effect. For the general method of finding the cheapest model for an input-heavy job, see Which LLM Is Cheapest for Your Workload.

What each model costs, by number of chunks

Cost per 1,000 requests, no caching, as top-k changes. The first column of each row is the model, with its ECI score in brackets.

Model (ECI)Price in / outk = 3k = 5k = 10k = 20k = 40
Claude Haiku 5.5 (160.3)$0.10 / $0.50$0.46$0.56$0.81$1.30$2.31
GPT-6 Luna (156.4)$0.10 / $0.50$0.46$0.56$0.81$1.30$2.31
DeepSeek V4.1 Flash 1017 (159.4, open-weight)$0.15 / $0.60$0.64$0.79$1.16$1.91$3.41
Gemini 3.1 Flash Lite (145.0)$0.25 / $1.50$1.21$1.46$2.09$3.34$5.84
Gemini 3.8 Flash (158.8)$0.75 / $3.75$3.41$4.16$6.04$9.79$17.29
GPT-6.1 Terra (167.7)$1 / $5$4.55$5.55$8.05$13.05$23.05
Gemini 4 Hydrogen (166.8)$1.50 / $7.50$6.83$8.33$12.08$19.57$34.58
Claude Sonnet 5.5 (166.6)$2 / $10$9.10$11.10$16.10$26.10$46.10

Three readings:

  • Model choice dominates. At k = 5, Sonnet 5.5 costs 20× Haiku 5.5, a gap that no retrieval tweak will close.
  • Top-k is the second-biggest lever. On Haiku 5.5, going from 5 chunks to 40 multiplies the bill by 4.2×, and going from 3 to 20 multiplies it by 2.9×. Each extra chunk adds 500 input tokens, which costs $0.05 per 1,000 requests on Haiku and $1.00 on Sonnet 5.5.
  • Gemini 3.1 Flash Lite is a poor RAG buy. It costs 2.6× Haiku 5.5 at k = 5 and scores 15 ECI points lower. Its output ratio is 6×, so its answers cost relatively more too.

Retrieving more chunks only pays if it raises answer quality. Many teams settle on a high k to protect recall, then discover that the model finds the answer in the top few and the rest is noise that costs money. Measure answer accuracy against k on your own questions. If accuracy flattens at k = 5, going to 20 is paying 2.3× for nothing. A reranker that picks the best 5 of 20 retrieved chunks, or smaller chunks, are usual ways to keep accuracy and cut input.

The cheapest model at each quality floor

Cost alone points at the smallest model. A quality floor tells you whether it is good enough. For the k = 5 request, with the stable prefix cached, the cheapest model above each ECI floor in our data is:

ECI floorCheapest modelECIPer 1,000 requests (no cache / prefix cached)
155Claude Haiku 5.5160.3$0.56 / $0.42
160Claude Haiku 5.5160.3$0.56 / $0.42
165GPT-6.1 Terra167.7$5.55 / $4.13
168Gemini 4 Carbon169.7$11.10 / $8.25

Haiku 5.5 is the cheapest model at every floor through 160. The jump to the 165 floor multiplies the cost 10×, and the next jump, to 168, doubles it again. ECI is a composite of general capability, not a RAG-specific test, so the more practical use is as a shortlist: if your documents are clean and your questions are lookups, a model at 155 to 160 reads and quotes well enough in many cases. If the answer needs multi-step reasoning across several chunks, or the documents are messy, test a model from the next tier up. Rankings of open-weight models, which can be cheaper still, are in Open-Weight vs Proprietary LLM Cost.

How caching changes the bill

In RAG, the retrieved chunks change on every query, so they cannot be cached. What can be cached is the prefix: the instructions, format rules and examples that open every request. Cache hits require an exact prefix match, so keep the stable text first and the retrieved chunks after it.

With the 1,500-token prefix fully cached, the k = 5 request drops as follows:

ModelNo cachePrefix cachedSavingPer 1M requests, no cache / cached
Claude Haiku 5.5$0.56$0.4224.3%$555 / $420
DeepSeek V4.1 Flash 1017$0.79$0.5728.0%$788 / $567
Gemini 3.8 Flash$4.16$3.1524.3%$4,163 / $3,150
GPT-6.1 Terra$5.55$4.1325.7%$5,550 / $4,125
Claude Sonnet 5.5$11.10$8.2525.7%$11,100 / $8,250

Per 1,000 requests, the saving is about a quarter, not 90%, because only 1,500 of the 4,050 input tokens are cacheable and output is never discounted. The cache-read discount in our data is 90% to 95% on these models, and 98% on DeepSeek V4.1 Flash 1017 ($0.003 against $0.15). The saving scales with how much of your prompt is stable:

  • A 6,000-token prefix (long policies, a glossary, many examples) with the same five chunks cuts the bill by 53.7% on Haiku 5.5 ($1.01 down to $0.47), and 56.7% on Terra ($10.05 down to $4.35).
  • A 50% hit rate halves the saving. On Terra the 1,500-token prefix then saves 12.8% instead of 25.7%. Cache entries expire, so low or bursty traffic will see misses.

Our price data holds only the cache-read price. Providers differ on cache write premiums, storage fees and expiry, none of which are included above, so confirm them in each provider's documentation. Prompt Caching Explained shows how to model a hit rate, and /cache-savings lets you try your own numbers.

Long context versus retrieval

Every model in the table accepts 1M tokens, so you could skip retrieval and put the whole document in the prompt. The cost says that is rarely wise. Take a 100,000-token manual queried repeatedly, with a 100-token question and 400-token answer, per 1,000 queries:

ModelWhole document, no cacheWhole document, cachedRAG (k = 5, 4,050 tokens in)
Claude Haiku 5.5$10.21$1.21$0.61
GPT-6.1 Terra$102.10$7.10$6.05
Claude Sonnet 5.5$204.20$14.20$12.10

Uncached, stuffing the document costs 17× the RAG request on every model. Fully cached, the gap closes to 1.2× on Terra and Sonnet 5.5 and 2.0× on Haiku 5.5, so even a perfect cache never makes it cheaper in these examples. These figures also assume every query hits a warm cache and ignore write fees, so they flatter long context. A cached whole-document prompt can still be the right design when quality is the problem: retrieval that misses answers spread across a document costs more in wrong answers than it saves. It suits a small set of hot documents queried often. For a large or changing corpus, retrieval wins on cost, and on speed, since fewer tokens are processed.

Context length matters for the other direction too. A larger window lets you raise k, but past a point more chunks add cost and noise, not accuracy. Check the window if you choose an older or smaller model: some current ones stop at 400K (GPT-5.4 Mini and Nano) or 262K (Gemma 4), which still holds hundreds of 500-token chunks.

Embeddings are the cheap part

A RAG pipeline pays for embeddings twice: once to index your corpus and once per query. Our embeddings page lists 250 embedding models, of which 44 have a price in the data; the retrieval score is MTEB English v2 retrieval, a public benchmark rather than a test on your documents. Priced models, per 1M input tokens:

ModelPriceMTEB retrievalMax input tokensDimensionsIndex 200M tokens
text-embedding-3-small$0.0253.488,1911,536$4
voyage-3$0.0653.4632,0001,024$12
text-embedding-004$0.1059.062,048768$20
text-embedding-3-large$0.1357.988,1913,072$26
gemini-embedding-001$0.1564.352,0483,072$30

A corpus of 50,000 documents at 4,000 tokens each is 200M tokens and costs $4 to $30 to embed, once. Embedding 1M user queries of about 30 tokens each is 30M tokens, which costs between $0.60 and $4.50. Compare that with generation: 1M requests on Haiku 5.5 is $555, on Terra $5,550. Even the most expensive embedding model's one-off $30 index equals the generation cost of about 54,000 Haiku 5.5 requests. Embedding cost only matters for very large corpora that are re-embedded often.

So pick the embedding model for retrieval quality, not price. Gemini-embedding-001 scores 10.9 points above text-embedding-3-small on the benchmark for $26 more on a 200M-token corpus, and better retrieval can let you use a smaller k or a cheaper generation model, which is where the real savings are. The highest MTEB retrieval scores in the data belong to open-weight embedding models with no hosted price listed, such as Qwen3-Embedding-8B (69.44). A missing price means we have no hosted price for it, not that it is free. Also check max input tokens: a 512-token limit, as on Cohere's embed-english-v3.0, constrains your chunk size.

Storing and searching the vectors is a separate bill. At 10M chunks it runs from a few hundred to several thousand dollars a month depending on the database; our vector database ranking prices ten of them at 1M, 10M and 100M vectors, and Vector Database Costs Compared explains why the cheapest option changes with scale. Reranking is a further cost outside our data.

How to decide

  1. Measure your request shape. Count the stable prefix, average chunks, chunk size and answer length with the token counter. The sizes above are placeholders.
  2. Test accuracy against k. Run 50 to 100 real questions at k = 3, 5, 10 and 20. Take the smallest k where accuracy stops improving.
  3. Find the cheapest model that passes. Start from Haiku 5.5 or GPT-6 Luna and move up only when the test fails. Use the quality-floor table to choose the next step, and /cheapest to see other options.
  4. Put the stable text first and verify cache hits in your provider's usage report before counting on the saving.
  5. Pick embeddings on retrieval score, then choose the chunk size that the model's input limit allows.
  6. Price the whole pipeline in the calculator and estimate before you build. Revisit when prices change.

The numbers in this article come from our model price data and the embeddings data, both updated November 25, 2026. Model prices come through an aggregator and can differ from provider price pages; see our methodology.