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

# Prompt caching

> Pareto caches prompts automatically. Cached input costs 2% to 20% of the input price.

Pareto caches prompts automatically. When a request starts with the same tokens as an earlier request, Pareto reuses that part of the prompt. You pay the cached input price for the tokens that usage reports as cached. You do not need to change your requests.

## Cached input price

| Model | Cached input price |
| - | - |
| GLM 5.3 Flash | 20% of the input price |
| DeepSeek V4.1 Flash | 2% of the input price |
| Kimi K3.1 Pro | 10% of the input price |

See [Token prices](https://docs.paretoinference.com/pricing.md#token-prices) for the prices in USD.

## How caching works

Pareto reuses the longest part of the prompt that matches an earlier request from the start. The tokens after the first difference are not cached.

Pareto sends the next requests of a conversation to the GPUs that hold its cached prompt. Each request in a conversation must start with the same messages as the earlier requests.

A cache hit is not guaranteed. A conversation that is idle for a long time can lose its cached prompt.

## Get more cache hits

1. Put the content that does not change first: the system message, the tool definitions, and reference documents.
2. Add new messages at the end of `messages`.
3. Do not edit or remove earlier messages.
4. Do not put a time, a date, or a request ID in the system message.
5. Use the same model for all requests in a conversation.

When an agent compacts a conversation, it replaces the earlier messages. The next request reads the new messages without the cache.

## Read cached tokens

The usage data of each API shows the cached tokens.

| API | Cached tokens | Input tokens |
| - | - | - |
| Chat completions | `usage.prompt_tokens_details.cached_tokens` | `usage.prompt_tokens` includes the cached tokens. |
| Responses | `usage.input_tokens_details.cached_tokens` | `usage.input_tokens` includes the cached tokens. |
| Messages | `usage.cache_read_input_tokens` | `usage.input_tokens` does not include the cached tokens. |

For Kimi K3.1 Pro, chat completions also show the count as `usage.cached_tokens`, as Moonshot's API does.

For streamed chat completions, set `stream_options` to `{"include_usage": true}` to get the usage event. See [Streaming](https://docs.paretoinference.com/api-reference.md#streaming).

`usage` does not show the charge. See [Balance and usage](https://docs.paretoinference.com/balance-and-usage.md) for charges.

## Cache hints

Pareto accepts `prompt_cache_key` in chat completions and Responses requests. Pareto accepts `cache_control` in Messages requests. You do not need these hints. Pareto caches prompts without them.

## Cached input share

Each model page shows the share of input tokens reported as cached in the last hour. See [GLM 5.3 Flash](https://paretoinference.com/models/glm-5.3-flash), [DeepSeek V4.1 Flash](https://paretoinference.com/models/deepseek-v4.1-flash), and [Kimi K3.1 Pro](https://paretoinference.com/models/kimi-k3.1-pro).

## Long conversations

Each model has a context window of 1,048,576 tokens. See [Model limits](https://docs.paretoinference.com/api-reference.md#model-limits).


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