# Prompt caching

> Cut My AI Spend — rank #2 of 10. Typical savings: Up to 90% off cached input tokens. Effort: Low — order your prompts, flip a flag.

Prompt caching reuses the computed state behind a repeated prompt prefix (system prompt, tool definitions, long documents), so the static part of every request bills at a steep discount — up to 90% off on Anthropic with explicit cache breakpoints, and ~50% automatically on OpenAI.
Production reports commonly land in the 50–80% cache-hit range once prompts are structured with the stable content first and the variable content last. For chat apps, agents, and anything with a large system prompt, this is the highest-leverage one-day fix available.

## How to do it

1. Restructure prompts: stable content (system prompt, tools, reference docs) first, variable content (user message) last.
2. On Anthropic, add cache_control breakpoints to the stable blocks; on OpenAI, caching applies automatically to repeated prefixes over 1024 tokens.
3. Keep the prefix byte-identical across requests — any change above the breakpoint invalidates the cache.
4. Track your cache-hit rate; below ~50% usually means something volatile (timestamps, request IDs) is leaking into the prefix.

## Frequently asked questions

### Does caching change the model output?

No. Prompt caching reuses computation for identical input prefixes; outputs are unaffected. It is purely a billing and latency optimization.

### How long do caches live?

Provider-dependent: Anthropic offers 5-minute and 1-hour TTLs, OpenAI caches typically persist minutes and extend while in use. High-traffic prompts stay hot on their own.


---
Canonical: https://cutmyaispend.com/methods/prompt-caching
All methods: https://cutmyaispend.com/ | JSON: https://cutmyaispend.com/api/methods.json