This calculator compares the monthly token cost of retrieving a small context for each request with sending a full document into every request. It includes a fixed monthly RAG infrastructure charge and shows the query volume at which lower per-query RAG cost pays for that charge.
Loading calculator...
The calculation is a cost view. Retrieval quality, document completeness, latency, and engineering effort require separate testing.
How to use it
Enter monthly queries, output tokens per query, prompt or instruction tokens, retrieved tokens per query, and full-document tokens. Defaults are 100,000, 400, 300, 2,500, and 40,000.
Enter RAG infrastructure per month, then input and output prices per million tokens. Defaults are $120, $3, and $15.
Check token counts on real retrieved chunks and full documents before comparing monthly totals.
Read both monthly-cost tiles, the winner, and RAG break-even. The output treats RAG as the winner on equal monthly cost.
Use the break-even result only when long-context input tokens exceed RAG input tokens; otherwise the source returns no finite break-even.
Fields explained
Queries / month – request volume, default 100,000.
Output tokens / query – generated tokens, default 400.
Prompt/instruction tokens – shared prompt content, default 300.
RAG: retrieved tokens / query – context sent after retrieval, default 2,500.
Long-context: full doc tokens – full document input, default 40,000.
RAG infra $/mo – embedding and vector database hosting, default $120.
Input price / 1M and Output price / 1M – default $3 and $15.
Reading the results
| Result | Meaning | Action |
|---|---|---|
| RAG / month | RAG token cost plus infra | Compare with long context. |
| Long context / mo | Full-document token cost | Check document size. |
| Winner | Lower monthly total | Read its savings. |
| RAG break-even | Queries covering RAG infra | Compare with volume. |
37,500 fewer input tokens per query save $0.1125 at the default $3 input rate.
Warning: the calculator does not charge for full-document preparation or retrieval misses.
Output-token cost is identical on both paths when the same output count and price are used, so it does not change the difference.
The formula
ragPer = (prompt + retrieved) × inputPrice + output × outputPrice. longPer = (prompt + fullDoc) × inputPrice + output × outputPrice. RAG monthly cost is ragPer × queries + infra; long-context cost is longPer × queries; break-even is infra / (longPer - ragPer).
| Default | Value |
|---|---|
| RAG input | 2,800 tokens |
| Long input | 40,300 tokens |
| Input price | $3/1M |
| Infrastructure | $120/month |
Defaults give RAG cost $0.0144 per query and long-context cost $0.1269. At 100,000 queries, RAG costs $1,560 and long context costs $12,690, so RAG saves $11,130. Break-even is 1,067 queries per month.
Info: the source labels this a cost view and states that long context can be more accurate when the whole document matters.
Both totals use entered prices divided by one million.
Worked examples
Low volume. At 100 queries, defaults make RAG $121.44 and long context $12.69. Long context wins by $108.75; use it if the full document is needed.
Break-even. At about 1,067 default queries, the infrastructure charge is paid by per-query savings. Test retrieval relevance before switching.
Growing workload. At 10,000 default queries, RAG costs $264 and long context costs $1,269. RAG saves $1,005; measure missed chunks.
Scale case. At 1M default queries, RAG costs $14,520 and long context costs $126,900. RAG saves $112,380 per month. Audit retrieval quality at scale.
Common mistakes
Entering a document count as full-document tokens understates long-context spend. Count tokens per request.
Leaving infrastructure at zero hides the RAG fixed charge. Include embedding and vector hosting.
Assuming cost selects quality ignores retrieval failures. Evaluate both paths on the same questions.
Danger: a zero per-query saving makes the break-even infinite.
Use the live calculator for the exact current input values.
FAQ
Does RAG include infrastructure?
Yes. The monthly RAG total adds the entered fixed charge.
The default charge is $120 each month.
Does long context include infrastructure?
No separate infrastructure field is added to long context.
It is token cost multiplied by queries.
Why do output tokens not change the winner?
They use the same count and price on both paths.
They increase both monthly totals equally.
What does break-even mean?
It is the volume that covers fixed RAG infrastructure.
The source divides infra by per-query saving.
Can long context be the right choice?
Yes. The source notes whole-document accuracy can matter.
At 100 default queries, long context costs less.
Disclaimer
This is an educational estimate for planning. Results depend on the model, provider, hardware, configuration, and current pricing, all of which change.
The live calculator on the page is the source of truth for its exact fields. Verify against current prices and a small real test before scaling spend.







Does this calculator work on mobile? Tried opening it on my iPhone and the input fields are stacked weirdly, hard to compare the two columns side-by-side. Also the RAG break-even result doesn’t seem to update when I change query volume. Desktop version is fine but the responsive design needs work for anyone trying to run numbers on the go.
Thanks for flagging the mobile UX issue. You’re right that the side-by-side comparison layout gets cramped on smaller screens. We’ve noted this for the next iteration, where we’ll likely shift to a stacked card layout on mobile that still lets you see both RAG and long-context totals clearly. Regarding the break-even not updating, that’s actually by design based on the formula: break-even only calculates when long-context input tokens exceed RAG input tokens. If your RAG retrieved tokens are already larger than the full-document tokens you entered, the calculator returns no finite break-even (since RAG would always be cheaper). Double-check that your full-doc token count is genuinely larger than retrieved tokens per query. If it is and you’re still seeing the issue, send a screenshot to support and we can debug. The desktop version definitely has more breathing room for this comparison, so for now that’s the better experience for detailed analysis.