What it removes
Every message in the request, the system prompt included, goes through three transforms, in this order:
The result is deterministic: the same input compresses to the same bytes on
every turn, so a provider’s prompt cache keeps matching the conversation’s
prefix instead of missing on every request.
What it leaves alone
The policy never trades tokens for silent data loss, so it steps aside whenever it cannot be sure of a lossless rewrite. The whole request passes through untouched when:- Any content is under 256 bytes. Short, stable text such as a system prompt is worth more as a cache hit than as a few saved bytes.
- The body is over 1 MiB.
- The request carries something the rewrite cannot reproduce exactly: image,
audio or document parts, an Anthropic
cache_controlmarker, Anthropictool_resultblocks, or fields the gateway does not model. - The request is not OpenAI-style Chat Completions (OpenAI, Azure OpenAI, Groq, DeepSeek, xAI, OpenRouter) or Anthropic Messages.