> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aesoteric.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt caching and privacy

> How repeated prompts get faster and cheaper, how to turn caching off, and what is kept.

## 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](https://app.aesoteric.ai/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:

| Where | How |
| - | - |
| Request body | `"prompt_cache_retention": "none"` |
| Header | `x-prompt-cache-retention: none` |

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.

```python OpenAI Python theme={null}
completion = client.chat.completions.create(
    model="<model-id>",
    messages=[{"role": "user", "content": "Say hello."}],
    extra_body={"prompt_cache_retention": "none"},
)
```

```python Every request of a client theme={null}
client = OpenAI(
    base_url="https://api.aesoteric.ai/v1",
    api_key=os.environ["AESOTERIC_API_KEY"],
    default_headers={"x-prompt-cache-retention": "none"},
)
```

```bash Claude Code theme={null}
export ANTHROPIC_CUSTOM_HEADERS="x-prompt-cache-retention: none"
```

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](https://app.aesoteric.ai/usage) page.
* Responses are not stored: the [Responses](https://docs.aesoteric.ai/api-formats.md#responses) format refuses `store: true` and `previous_response_id`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.