/v1/chat/completions and /v1/responses endpoints.
View cache analytics in the Requesty Console.
What Auto Cache Does
Auto caching is provider-level prompt caching. When enabled, the router automatically adds cache breakpoints to the largest content blocks in your request before forwarding it to the provider (for providers that require explicit breakpoints, such as Anthropic). The provider then caches those token prefixes on their side. For providers that cache automatically, no breakpoints are needed — caching just happens. This means:- You still send the full message history with every request. The payload size does not change.
- The provider recognizes cached prefixes and charges reduced rates for tokens it has already seen.
- Cache hits are billed at a fraction of the normal input token cost (up to 90% savings).
How Auto Cache Works
Theauto_cache flag is a boolean parameter sent within the requesty field in your request payload.
Chat Completions API
Include theauto_cache flag within the requesty object in your request:
Responses API
Auto caching works identically on the/v1/responses endpoint. Include the same requesty.auto_cache flag:
Multi-turn with Responses API
For multi-turn conversations, include the full conversation history in theinput array along with the requesty.auto_cache flag. The router caches the largest content blocks so the provider charges reduced rates for the repeated prefix:
Auto Cache vs. Response IDs
OpenAI’s Responses API supports aprevious_response_id parameter that lets OpenAI store conversation state server-side so you don’t have to resend the full history. This is an OpenAI-specific feature — it works when routing to OpenAI models through Requesty, because OpenAI handles the storage on their end.
For non-OpenAI models, previous_response_id is not available because these providers don’t store responses server-side. Instead, send the full conversation history (with auto_cache for providers that need explicit breakpoints) to get cost savings:
Important Notes
Provider Support: Prompt caching works with any provider that supports it. The
auto_cache flag matters mainly for providers that require explicit cache breakpoints or charge extra for cache writes (such as Anthropic); many other providers cache automatically regardless of the flag.- Explicit Control:
auto_cacheprovides explicit control. Set totrueto attempt caching,falseto prevent caching for providers where cache writes incur extra costs. - Default Behavior: If
auto_cacheis not specified, the caching behavior reverts to defaults based on request origin. - Cost Savings: Cache hits are billed at a fraction of the normal input token cost. This is especially effective for applications with large system prompts or knowledge bases.
- Minimum Token Length: Providers enforce a minimum cacheable prefix length (for example, at least 1,024 tokens for Anthropic, 2,048 for Claude 3.5 Haiku). Content shorter than the provider’s minimum will not be cached.
- Automatic Provider-Side Caching: Many providers (e.g., OpenAI, DeepSeek, Gemini implicit caching) apply prompt caching automatically on their side. You’ll see cache hits in your cache analytics even without setting
auto_cache. - Vertex AI file attachments: For
vertex/...Gemini models, auto caching is skipped when the cacheable prefix includes file attachments with URIs that are not on Google Cloud Storage (gs://). External file URLs (for examplehttps://...) still work for inference, but explicit cache creation is not attempted for those requests. Inline/base64 attachments (file_data) andgs://URIs are supported in cached content.