Property CacheSystemPrompt
Ask the provider to mark the system prompt as cacheable, so repeated turns re-read it
instead of paying for it again.
Only worth setting when the system prompt is byte-stable across requests.
Caching is a prefix match: the provider renders tools, then system, then messages, and any
byte change invalidates everything after it. A system prompt carrying a timestamp, a user
name, or anything else that varies per request will simply never be read back — you pay
the write premium for nothing.
There is a length floor and it is model-dependent (roughly 1–4k tokens on
current Anthropic models). A shorter prefix silently does not cache: no error, and
cache_creation_input_tokens stays at zero. That, and cache_read_input_tokens
staying at zero across repeated calls, are the two things to look at when it seems not to
work.
Providers that have no cache concept ignore this flag.
public bool CacheSystemPrompt { get; init; }