Key Info
Adding the header X-OpenRouter-Cache: true makes OpenRouter save the entire response; resending the exact same request returns it in about a second at $0 cost, skipping the model entirely. This differs from prompt caching, which only discounts the repeated input portion while the model still runs.
Highlights
- Full response is stored and replayed for $0 on identical requests
- Returned in about a second, with no model call
- Unlike prompt caching, which still runs the model
- Cache lasts 5 minutes by default, up to 24 hours via X-OpenRouter-Cache-TTL
- Useful for iterating during development without paying per generation