Prompt caching vs response caching: what is the difference?
Prompt caching and response caching save cost at different points in an LLM call. Prompt caching reuses a repeated prompt prefix, such as a long system prompt or document, at the model provider, which bills those input tokens at a reduced rate while the model still generates a fresh completion. Response caching stores a complete response at the gateway or application layer and returns it for an identical or similar request, so the model is not called at all. They are complementary: response caching saves the whole call, and prompt caching saves the repeated context within a call.
Last updated
Key facts
- Prompt caching discounts repeated input tokens; the model still generates a new completion.
- Response caching returns a stored response and skips the model call.
- On FastRouter, response cache hits are billed at 0.1× standard token pricing and cache storage is free.
- On FastRouter, provider-native prompt caching is included on every plan; response caching is included from the Pro plan.
- The two are complementary and can be used on the same traffic.
What is prompt caching?
Prompt caching is a feature of model providers that stores the processed form of a repeated prompt prefix. When a later request starts with the same content, the provider reads it from cache and bills those input tokens at a reduced rate. The model still runs and produces a new completion.
Prompt caching depends on the start of the prompt staying the same between requests. Large static content, such as system instructions, retrieved context and few-shot examples, belongs at the beginning of the prompt, with content that changes at the end.
What is response caching?
Response caching stores the full response to a request in a cache that sits in front of the model, usually in a gateway or in the application. When a matching request arrives later, the stored response is returned and the model is not called, which removes both the model cost and the model latency.
Matching can be exact, where only an identical request reuses a response, or semantic, where a request that is close enough in meaning also counts as a match. Entries expire after a time to live, so stale answers are eventually replaced.
How do prompt caching and response caching compare?
The two differ in what is reused, where the cache lives and whether the model runs. Prompt caching reuses part of the input and still produces a new output. Response caching reuses the whole output and produces nothing new. The table below sets out the differences that matter when choosing between them.
| Aspect | Prompt caching | Response caching |
|---|---|---|
| What is reused | A repeated prompt prefix (input tokens) | A complete stored response |
| Where the cache lives | At the model provider | At the gateway or application layer |
| Model call | Still made | Skipped on a cache hit |
| Output | Freshly generated on every request | The stored response, returned again |
| What is saved | Cost of the repeated input tokens | Cost and latency of the whole call |
| What must match | The beginning of the prompt | The request, exactly or by similarity |
| Typical fit | Long system prompts, document Q&A, multi-turn chat | FAQs, repeated queries, summaries that are requested again |
When should you use each one?
Use prompt caching when requests share a long, stable beginning but need a different answer each time. Use response caching when the same or a very similar request recurs and the same answer is acceptable. Many workloads have both patterns, so the two are often enabled together.
- Prompt caching fits long system prompts and tool definitions, question answering over the same documents, growing conversation history and pipelines that reuse few-shot examples.
- Response caching fits frequently asked questions, stateless bots, dashboards that reload the same summaries and repeatable classification or description requests.
How FastRouter handles prompt caching and response caching
FastRouter offers both and treats them as separate features. Prompt caching is provider-native: the cache lives at the model provider, and FastRouter keeps each conversation on the provider whose cache is warm. Response caching is FastRouter's own gateway cache, so it works the same way across every provider you route to.
- Prompt caching is automatic, with no request changes, on OpenAI, DeepSeek, Google AI Studio, Google Vertex AI, Grok, Moonshot AI and Baseten. Anthropic Claude requires cache_control markers, with a 5-minute (default) or 1-hour TTL.
- Cached context is billed as low as 0.10× the normal input price on supported providers. Caching applies past a per-model minimum, for example 1,024 tokens on OpenAI.
- Response caching is enabled by sending a cache_key header. If the header is omitted, response caching is disabled.
- A similarity_threshold of 1.0 matches only identical requests. The default of 0.75 also reuses minor rewordings and paraphrases.
- Response cache lifetime defaults to 3,600 seconds and can be set from 60 to 86,400 seconds per request.
- Response cache hits return in under 10ms and are billed at 0.1× standard token pricing. Misses are billed at the standard rate and stored for reuse.
- Provider-native prompt caching is included on every plan. Response caching is included on Pro, Business and Enterprise, as listed on the pricing page.
Sources
Where the statements about FastRouter on this page come from.