Skip to main content
AIpricly

Chat with docs

Compare LLMs for retrieval-augmented generation: long-context handling, citation accuracy, monthly cost across providers.

Your usage

Default assumptions
Monthly requests300,000
Avg input tokens4000
Avg output tokens300

When to use this scenario

RAG (retrieval-augmented generation) injects relevant document chunks into the prompt. The defining characteristic: large input tokens (4K+) per query because you're feeding it retrieved context. Cost is dominated by input tokens.

Models with strong long-context handling and good in-context retrieval scores win here. Claude 4.6 Sonnet and Gemini 2.5 Pro lead on context window (200K and 2M respectively).

Common pitfalls

  • Stuffing too much context — diminishing returns past 8K tokens for most questions
  • Ignoring caching — prompt caching can cut input cost by 90% if your retrieved context is stable
  • Skipping reranking — better retrieval beats more context

Recommended routing

Sorted by best value for your usage
PRIMARY
Gemini 2.5 Pro
Google · quality 87 · 140 tok/s
Monthly cost$2.4K
Vs baseline0%
P50 latency0.8s
FALLBACK
Claude 4.6 Sonnet
Anthropic · quality 89 · 85 tok/s
Monthly cost$5.0K
Vs baseline-106%
P50 latency1.1s
DeepSeek V3.5
DeepSeek · quality 81 · 95 tok/s
Monthly cost$193
Vs baseline92%
P50 latency1.5s

Baseline = GPT-5 at the same usage = $2.4K/mo.

Routing simulator

Phase 2 preview

Drag the slider to split traffic between Gemini 2.5 Pro (primary) and Claude 4.6 Sonnet (fallback). See how your monthly bill moves — without writing a line of gateway code.

Primary: Gemini 2.5 ProFallback: Claude 4.6 Sonnet
70% Gemini30% Claude
Blended monthly cost$3.2Kat the usage assumed above

Phase 2 turns this routing into a real OpenAI-compatible endpoint — one key, one bill, automatic failover. Drop your email to be notified at launch.

Stored in your browser only until our email backend lands. No tracking, one click to remove.

Use this routing via API

Phase 2 preview · gateway not live yet
PHASE 2 PREVIEW · gateway not live yetThis endpoint does not exist yet. The gateway is in Phase 2 — what you see below is a design preview of the planned interface, not a live API. We will email subscribers when it launches.
Preview the planned API call
$ curl https://api.aipricly.com/v1/chat/completions \
  -H "Authorization: Bearer $AIPC_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "scenario": "chat-with-docs",
    "messages": [{"role": "user", "content": "..."}]
  }'

Related scenarios