USE CASE · VERIFIED 1 NOV 2026

What's the cheapest AI API for RAG pipelines right now?

For a typical RAG workload of 400M input tokens and 40M output tokens a month, DeepSeek V4.1 Flash is cheapest at $38/mo, followed by GPT-6 Luna and Claude Haiku 5.5, which tie at $60/mo. Qwen3.8 Flash follows at $79/mo and GLM 5.3 Flash at $80/mo.

Worked example: 400M input, 40M output tokens/month

Retrieved chunks stuffed into the prompt, short grounded answers. The six cheapest of the 35 models we track, plus two flagships for scale. Open-weight models are priced at the original provider's own list price.

DeepSeek V4.1 Flash$38/mo
GPT-6 Luna$60/mo
Claude Haiku 5.5$60/mo
Qwen3.8 Flash$79/mo
GLM 5.3 Flash$80/mo
GPT-4o mini$84/mo
Grok 4.7$1,040/mo
Gemini 3.1 Pro$1,280/mo

Why RAG pricing is input-heavy

RAG pipelines stuff retrieved chunks into the prompt and then ask for a short grounded answer, so the token ratio is almost always input-heavy — in this worked example, 10 input tokens for every output token. That means the per-token input price matters far more than the output price for total cost. Models with a cheap input rate but expensive output (like Gemini 2.5 Flash at $0.3/$2.5) can end up costing more than models with a slightly higher input rate but much cheaper output (like DeepSeek V3 at $0.27/$0.41), depending on your actual ratio. Always re-run the math on your own input/output split before picking a model on price alone.

Budget tier is where RAG actually lives

Every model worth considering for a cost-sensitive RAG pipeline sits in the budget tier: DeepSeek V4.1 Flash, GPT-6 Luna, Claude Haiku 5.5, Qwen3.8 Flash, GLM 5.3 Flash, GPT-4o mini, MiniMax M3.1 Flash, DeepSeek V3, MiniMax M3, MiMo V2.6 Pro, and Gemini 2.5 Flash all land between $38 and $220/mo for this workload. Mid-tier models like Gemini 3 Flash ($320/mo) or GPT-6.1 Terra ($600/mo) cost multiples more for the same volume. Unless your RAG answers need deeper reasoning over the retrieved context, there's rarely a reason to leave the budget tier for straightforward grounded Q&A.

Context window, caching, and batching change the math

Most budget models here offer a 1M token context window, which comfortably fits large chunk sets — GPT-4o mini and DeepSeek V3 are outliers at 128K, worth checking if your retrieved context plus history is large. Prompt caching is particularly relevant for RAG because the same chunks, system prompt, or few-shot examples often repeat across requests; providers that support caching typically discount repeated input tokens, often around half, which can meaningfully cut your effective cost below the sticker price used here. Batching output generation (processing many queries asynchronously) can also unlock lower rates on some providers. Check your specific provider's caching and batching terms — the numbers above assume no discounts.

How we'd actually decide

Worked example uses standard (non-batch, non-cached) list pricing verified 1 November 2026. Prices change; use the calculator for today's numbers with your own volume. DeepSeek figures use DeepSeek's own weekday list price. On the weekends of 3–4 and 10–11 October we saw DeepSeek charge half of that, so if your jobs run on weekends the DeepSeek numbers can come in lower.

Frequently asked questions

What is the single cheapest model for RAG right now?

DeepSeek V4.1 Flash, at $0.045/$0.5 per 1M input/output tokens, which comes to $38/mo for a 400M input + 40M output token month.

Is the cheapest model always the best choice for RAG?

No. The cheapest model just wins on this specific token math. Budget models generally trade off reasoning depth and instruction-following for low price, so if your grounded answers need more careful synthesis across chunks, a mid-tier model like Gemini 3 Flash ($320/mo) or GPT-6.1 Terra ($600/mo) may be worth the extra cost.

Does context window size matter for RAG pricing?

Yes — most retrieved-chunk workloads need enough context to hold all the stuffed chunks plus the query. Most cheap options here (DeepSeek V4.1 Flash, GPT-6 Luna, Claude Haiku 5.5, Qwen3.8 Flash, GLM 5.3 Flash) offer a 1M token context window, while GPT-4o mini and DeepSeek V3 are limited to 128K, which could force you to retrieve fewer chunks or truncate.

Prices on this page change. Get told when they do.

One email the day a tracked model changes price or a new one launches. Nothing else, unsubscribe anytime.