Docs menu
Caching
Don't pay to compute the same answer twice. Sluice serves identical requests from cache, and marks long repeated prompt prefixes for the provider's own prompt cache.
Exact-repeat cache
When an identical request comes in again, Sluice returns the stored answer instantly — no provider call, no provider fee, milliseconds instead of seconds. It's on by default at temperature 0 (where output is deterministic). Control it per request:
{
"model": "gpt-4o",
"messages": [{ "role": "user", "content": "Classify: 'ships in 2 days'" }],
"temperature": 0,
"cache": true,
"cache_ttl": 86400
}What a cache hit costs
A cached response has cost_usd: 0 and cached: true in its receipt. There's no provider fee; you pay only our small share of the saving versus the direct price — so repeats are dramatically cheaper, not free of charge.
Provider prompt caching
When a long prompt prefix repeats across calls — a big system prompt, chat history, or documents — Sluice marks it for the provider's prompt cache (e.g. Anthropic's), where that cached input is billed at a fraction of the normal price. This happens automatically; no code change.
cache: false) for personalized or time-sensitive answers.