# Prompt caching

> Which model families cache prompts through the Hollow model API, and where to read cached tokens in the OpenAI and Anthropic responses and on Usage.

Whether a request is served from a prompt cache depends on the model family. You do not switch it on.

## Which models cache

**Prompt caching by model family**

| Family | Caching through this API |
| --- | --- |
| GPT | Automatic. A request that begins with the same text as an earlier one reads that part from the cache. |
| Gemini | Automatic, on the same basis. |
| Claude | None. Claude caches only where a request marks a cache breakpoint, and this API sets none, so a Claude model reads nothing from a cache here. |

The models that have a prompt cache, and their cache read and write prices, are in the [Models](https://platform.projecthollow.com/models/) table. For the other families this page makes no claim.

## Get cache hits

- Keep the start of the request the same: the system prompt, the tool definitions and the earlier messages, in the same order.
- Put what changes, such as the latest question, at the end.

Neither endpoint reads `cache_control`. A request that sends it runs normally, and does not make a Claude model cache.

## Read cached tokens

**The usage of a reply that read from the cache**

**OpenAI-compatible**

```json
{
  "usage": {
    "prompt_tokens": 2000,
    "completion_tokens": 8,
    "total_tokens": 2008,
    "prompt_tokens_details": {
      "cached_tokens": 1900
    }
  }
}
```

**Anthropic-compatible**

```json
{
  "usage": {
    "input_tokens": 100,
    "cache_read_input_tokens": 1900,
    "cache_creation_input_tokens": 0,
    "output_tokens": 8
  }
}
```

- OpenAI-compatible: `usage.prompt_tokens_details.cached_tokens` is the part of `prompt_tokens` read from the cache. When tokens were written to the cache, `cache_creation_tokens` sits beside it. The block is left out when there was neither.
- Anthropic-compatible: `usage.cache_read_input_tokens` and `usage.cache_creation_input_tokens` are always present. `input_tokens` counts only the tokens that were not cached.
- Streaming: the OpenAI-compatible stream ends with a chunk that carries `usage`, and the Anthropic-compatible `message_delta` event carries it.

## See it on Usage

[Usage](https://platform.projecthollow.com/usage/) shows the share of input served from the cache as Cache hits, for the whole account or for one project or key. The request log lists input, cached, cache write and output tokens for each request.
