Skip to main content

Prompt caching

Repeated and continued prompts are served from a cache, so they start sooner and their cached input is billed at the cached rate shown on the Models page. Caching is automatic and on by default in every format. You don’t need to mark anything: unlike Anthropic’s API, a Messages request without cache_control is cached too.
  • Per account. A request reuses only what earlier requests from the same account sent, from any of its keys. Other accounts’ prompts are never reused.
  • In memory, for an hour. The cache holds a conversation so far, prompts and answers, in memory only. Nothing of it is written to disk. An entry is deleted 60 minutes after it was last used, and the cache can be emptied earlier, for example by a restart.
  • Reported in usage. Cached input tokens are in usage.prompt_tokens_details.cached_tokens (Chat Completions), cache_read_input_tokens (Messages) and input_tokens_details.cached_tokens (Responses).
  • cache_control is accepted and ignored, and cache_creation_input_tokens is always 0.

Turn caching off

Turn caching off for a request with the body field or the header: A request with caching off reuses nothing (its cached_tokens is 0), and the cache keeps nothing of it: not its prompt, its answer or its token count. It is billed at the uncached rate. If caching can’t be turned off at that moment, such a request is answered 503 instead of being cached. "in_memory", "24h" or no value keep the default (an entry still expires after 60 minutes). Any other value is answered 400. "prompt_cache_options": {"mode": "explicit"} also turns caching off; "implicit" leaves it on.
The Anthropic SDKs take the same extra_body field or default_headers header.

What is kept

  • Prompts and answers are not written to Aesoteric’s request logs or database.
  • For each request, Aesoteric keeps its token counts and cost, for billing and the Usage page.
  • Responses are not stored: the Responses format refuses store: true and previous_response_id.