How this workload behaves
In a RAG workload, input tokens dominate costs because the model must ingest large volumes of retrieved context (e.g., documents, embeddings, or prior conversation) before generating responses. Output tokens, while expensive per-token, are typically a smaller fraction of total volume. The high input cost is driven by the need to pass extensive context to ensure accurate, grounded answers, while output costs scale with the length and complexity of the generated response. Models with larger context windows (like Opus 4.7’s 200K tokens) are often chosen for their ability to handle long contexts, but this comes at a premium.
Compare against 5 alternatives
| Model | Vendor | Monthly cost | vs primary | Δ |
|---|---|---|---|---|
| Claude Sonnet 4.6 | Anthropic | $60.00 | 0.20× | $240.00 |
| Claude Haiku 4.5 | Anthropic | $20.00 | 0.07× | $280.00 |
| Mistral Small | Mistral | $3.20 | 0.01× | $296.80 |
| GPT-4o mini | OpenAI | $2.70 | 0.01× | $297.30 |
| Gemini 1.5 Flash | $1.35 | 0.00× | $298.65 |
Recommendation
For this RAG workload, **Gemini 1.5 Flash** is the clear winner, offering the lowest total cost at just $1.35/month (0.45% of the primary model’s cost) while maintaining strong performance for context-heavy tasks. The 99.55% cost reduction ($298.65/month saved) is substantial, and the model’s balance of efficiency and capability makes it ideal for high-volume, input-heavy use cases. Only downgrade further if you can tolerate minor drops in answer quality or context comprehension.
Cost-saving tactics for this workload
- Use **context compression** (e.g., rerankers, summarization, or embeddings) to reduce input token volume before passing data to the LLM. Even a 30% reduction in context length would save ~$45/month with Opus 4.7.
- Implement **prompt caching** for repeated queries or static context (e.g., product catalogs, FAQs). Anthropic’s prompt caching can reduce input costs by up to 90% for cached prompts.
- Batch API calls to amortize overhead and reduce per-request costs. For RAG, batching retrieval and generation steps (e.g., processing multiple queries in parallel) can lower total token usage.
- Route simple queries to a **smaller model** (e.g., Haiku or Mistral Small) and reserve Opus 4.7 for complex, high-stakes tasks. A lightweight router can cut costs by 50–80% for low-complexity requests.
- Optimize retrieval pipelines to **minimize context length** by filtering irrelevant documents or using sparse retrieval (e.g., BM25) before dense retrieval. This directly reduces input token costs.
- Monitor **token efficiency** with tools like `tiktoken` to identify bloated prompts or redundant context. Even small tweaks (e.g., removing stop words) can yield 5–15% savings.