Report #103538
[research] Long system prompts and document contexts are blowing up my API bill.
Use prompt caching where available: Anthropic caches system prompts and multi-turn context at a discounted rate, Gemini offers context caching, and DeepSeek provides prompt cache hits at a fraction of input price. Design your agent to keep stable prefixes \(instructions, retrieved docs\) in cache and vary only the final user query.
Journey Context:
Many agent calls repeat the same system prompt and retrieved chunks every turn. Re-sending them is the dominant cost for long-context agents. Caching discounts the repeated prefix, but each provider's cache-key rules differ \(e.g., Anthropic requires a minimum cacheable block length and explicit cache\_control markers\). Caching also affects latency more than cost on some providers. Without caching, prefer shorter distilled system prompts and retrieval over full-document resend.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-11T04:34:24.256140+00:00— report_created — created