Skip to main content
Prompt caching reuses the KV cache from a recent request when the beginning of your prompt matches — automatically, and best-effort. Prompt cache retention goes further: it lets you explicitly keep a prompt prefix cached for a fixed window — 5 minutes or 1 hour — so reuse is guaranteed for that window instead of depending on whether the prefix happens to still be warm. While a prefix is retained, every request that reuses it skips prefill for a faster time to first token and is billed at the discounted cache-read rate. Opening the window costs a small cache-write premium upfront.

Quick start

Send prompt_cache_key with every request in a session. Add prompt_cache_options on the first one to open the window.

Request parameters

Window lifecycle

Retention is scoped to your account and prompt_cache_key. It works with streaming and non-streaming, chat and text-completions.
You’re charged a cache write each time a request writes new blocks or extends the window — not just on the first request. For example, send the same prompt with a ttl twice and the second call extends the window, so it’s charged as another cache write. Send a ttl only to open the window or when you deliberately want to extend it; for ordinary reuse, omit ttl and pay the cheaper cache-read rate.

Cache breakpoints

Most prompts are a stable prefix (system instructions, tools, a document) followed by a variable tail. Mark where the reusable prefix ends with a prompt_cache_breakpoint on a message content part — retention then applies to everything up to and including that part, and ignores the variable remainder, so the retained cache stays stable across requests even as the question changes.
Put anything that changes between calls (timestamps, user ids, retrieved chunks) after the breakpoint, so the prefix before it stays identical and matches in full. Changing a token inside the retained prefix only recomputes from the point of divergence onward — you still get the cache-read rate on the portion that still matches.

Cache granularity

Caches are written in fixed increments, so the retained portion is always rounded down to a whole multiple of the model’s cache granularity. Whatever is left over is billed as standard input. The granularity differs per model. On Nemotron-3-Ultra it is 8,192 tokens: a 20,000-token prompt retains 16,384 tokens (two increments), and the remaining 3,616 are billed as standard input. A breakpoint shorter than one increment retains nothing.
Check the model page for the granularity of the model you’re using — it determines how much of your prompt is actually cacheable.

Reading the response

Every response reports what happened in usage.prompt_tokens_details.

Pricing

Relative to the model’s standard input price: Only whole cacheable blocks count as cache read/write; any remainder is billed as standard input. The write premium applies only when a request actually creates or extends the retention window — reuse inside a window you’ve already paid for is billed at the read rate.

Model support

More models to follow. On a model without retention support, prompt_cache_options is ignored and the request is billed as standard input.