Best LLM API Models for RAG

RAG workloads often need enough context for retrieved passages plus economical input pricing. This page starts with large context windows and practical cost signals.

50Models listed
1M + 500KCost example tokens
USD / 1MNormalized prices

Quick shortlist

Start with Grok 4.1 Fast.

This guide is sorted by context window, so the first rows are the strongest starting point for RAG, long documents, and large codebase context.

Lead model 🔥Grok 4.1 Fast
ProviderxAI
Sample cost$0.45
Context2M

The ranking is a discovery aid, not a final recommendation. Always compare the model against your workload and verify provider pricing before production use.

How to read this ranking

Models are sorted by context window size. Use this page when your workflow needs long documents, large retrieval payloads, or multi-file context.

Model Ranking

Browse all models
ModelProviderPromptOutputExample CostYour CostContextRankRelease
🔥Grok 4.1 FastxAI$0.2$0.5$0.45$0.452M#182025-11-19
Grok 4.20 Multi-AgentxAI$2$6$5$52MUnranked2026-03-31
Grok 4.20xAI$1.25$2.5$2.5$2.52MUnranked2026-03-31
Grok 4 FastxAI$0.2$0.5$0.45$0.452MUnranked2025-09-19
🔥GPT-5.5OpenAI$5$30$20$201.05M#192026-04-24
OpenAI GPT LatestOpenAI$5$30$20$201.05MUnranked2026-04-27
GPT-5.5 ProOpenAI$30$180$120$1201.05MUnranked2026-04-24
GPT-5.4 ProOpenAI$30$180$120$1201.05MUnranked2026-03-05
GPT-5.4OpenAI$2.5$15$10$101.05MUnranked2026-03-05
🔥Owl AlphaOpenRouter$0$0$0$01.05M#172026-04-28
🔥DeepSeek V4 FlashDeepSeek$0.126$0.252$0.25$0.251.05M#42026-04-24
🔥Gemini 3 Flash PreviewGoogle$0.5$3$2$21.05M#62025-12-17
🔥DeepSeek V4 ProDeepSeek$0.435$0.87$0.87$0.871.05M#82026-04-24
🔥Gemini 2.5 Flash LiteGoogle$0.1$0.4$0.3$0.31.05M#112025-07-22
🔥Gemini 2.5 FlashGoogle$0.3$2.5$1.55$1.551.05M#132025-06-17
NewGemini 3.1 Flash LiteGoogle$0.25$1.5$1$11.05MUnranked2026-05-07
Google Gemini Pro Latestgoogle$2$12$8$81.05MUnranked2026-04-27
Google Gemini Flash Latestgoogle$0.5$3$2$21.05MUnranked2026-04-27
MiMo-V2.5-ProXiaomi$1$3$2.5$2.51.05MUnranked2026-04-22
MiMo-V2.5Xiaomi$0.4$2$1.4$1.41.05MUnranked2026-04-22
Lyria 3 Pro PreviewGoogle$0$0$0$01.05MUnranked2026-03-30
Lyria 3 Clip PreviewGoogle$0$0$0$01.05MUnranked2026-03-30
MiMo-V2-ProXiaomi$1$3$2.5$2.51.05MUnranked2026-03-18
Gemini 3.1 Flash Lite PreviewGoogle$0.25$1.5$1$11.05MUnranked2026-03-03
Gemini 3.1 Pro Preview Custom ToolsGoogle$2$12$8$81.05MUnranked2026-02-25
Gemini 3.1 Pro PreviewGoogle$2$12$8$81.05MUnranked2026-02-19
Gemini 2.5 Flash Lite Preview 09-2025Google$0.1$0.4$0.3$0.31.05MUnranked2025-09-25
Gemini 2.5 ProGoogle$1.25$10$6.25$6.251.05MUnranked2025-06-17
Gemini 2.5 Pro Preview 06-05Google$1.25$10$6.25$6.251.05MUnranked2025-06-05
Gemini 2.5 Pro Preview 05-06Google$1.25$10$6.25$6.251.05MUnranked2025-05-07
Llama 4 MaverickMeta$0.15$0.6$0.45$0.451.05MUnranked2025-04-05
Gemini 2.0 Flash LiteGoogle$0.075$0.3$0.22$0.221.05MUnranked2025-02-25
Gemini 2.0 FlashGoogle$0.1$0.4$0.3$0.31.05MUnranked2025-02-05
GPT-4.1OpenAI$2$8$6$61.05MUnranked2025-04-14
GPT-4.1 MiniOpenAI$0.4$1.6$1.2$1.21.05MUnranked2025-04-14
GPT-4.1 NanoOpenAI$0.1$0.4$0.3$0.31.05MUnranked2025-04-14
Palmyra X5Writer$0.6$6$3.6$3.61.04MUnranked2026-01-21
MiniMax-01MiniMax$0.2$1.1$0.75$0.751MUnranked2025-01-15
🔥Claude Opus 4.7Anthropic$5$25$17.5$17.51M#22026-04-16
🔥Claude Sonnet 4.6Anthropic$3$15$10.5$10.51M#32026-02-17
NewClaude Opus 4.7 (Fast)Anthropic$30$150$105$1051MUnranked2026-05-12
Grok 4.3xAI$1.25$2.5$2.5$2.51MUnranked2026-04-30
Anthropic Claude Sonnet LatestAnthropic$3$15$10.5$10.51MUnranked2026-04-27
Qwen3.5 Plus 2026-04-20Qwen$0.4$2.4$1.6$1.61MUnranked2026-04-27
Qwen3.6 FlashQwen$0.25$1.5$1$11MUnranked2026-04-27
Claude Opus LatestAnthropic$5$25$17.5$17.51MUnranked2026-04-21
Claude Opus 4.6 (Fast)Anthropic$30$150$105$1051MUnranked2026-04-07
Qwen3.6 PlusQwen$0.325$1.95$1.3$1.31MUnranked2026-04-02
Qwen3.5-FlashQwen$0.065$0.26$0.2$0.21MUnranked2026-02-25
Qwen3.5 Plus 2026-02-15Qwen$0.26$1.56$1.04$1.041MUnranked2026-02-16

Pricing FAQ

How is the sample workload cost calculated?

The sample workload uses 1 million input tokens plus 500 thousand output tokens, then applies each model's normalized USD price per 1 million tokens.

Why do input and output token prices matter separately?

Many applications are output-token heavy, while retrieval and classification workloads may be input-token heavy. Comparing both prices helps avoid picking a model that is cheap for the wrong workload shape.

Should I verify prices before production use?

Yes. AI Model Matrix normalizes public pricing metadata for comparison, but provider availability, limits, and prices can change. Always verify the final contract or provider dashboard before production use.

Related Guides

Cheapest LLM APIs

Sort models by estimated workload cost and normalized token prices.

Open guide

Largest Context Windows

Find models for long documents, retrieval, and codebase context.

Open guide

Coding Models

Compare code-oriented models by cost, context, and popularity rank.

Open guide

Free Models

Browse zero-price models for prototypes and evaluation.

Open guide

RAG Models

Start from large context windows and practical input-cost constraints.

Open guide

Chatbot Costs

Find budget-sensitive models for output-heavy assistant traffic.

Open guide