---
title: "What are cached input tokens? Prompt caching explained"
description: "Cached input tokens are prompt tokens a provider reuses from a recent request and bills at a lower rate. How prefix caching works, and how to measure and raise it."
url: https://broadrouter.com/glossary/cached-input-tokens/
lang: en
updated: 2026-11-14
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Cached input tokens

Updated 2026-11-14

Cached input tokens are prompt tokens that an LLM provider has recently processed and can reuse from a cache instead of computing again, usually a repeated prefix such as a system prompt or document. Providers bill them at a lower rate than new input tokens.

Also called: prompt caching, cache hits, cached tokens, context caching, cache read tokens

Most of what an agent sends is the same on every turn. Prompt caching lets the provider skip recomputing that repeated part, and bill it for less.

## How it works

When a model reads a prompt, it computes internal state for every token. A provider can keep that state for a short time. If the next request starts with the same tokens, the provider reads the stored state instead of recomputing it. Those tokens are **cached input tokens**.

Caches match from the start of the prompt. OpenAI’s guide says reuse “requires the entire rendered prefix to match.” One changed character early in the prompt makes everything after it new input.

Providers differ in the details:

-   **OpenAI** enables caching by default on supported models and reports hits in the usage block. It documents a 1,024-token minimum prefix on its newer models.
-   **Anthropic** bills cache reads at 0.1 times the base input price for most models, bills cache writes at a premium, and keeps entries for 5 minutes by default.

In the Chat Completions format, hits appear as `usage.prompt_tokens_details.cached_tokens`. Cache rate is that number divided by `prompt_tokens`.

## Why it matters

For long, repeated prompts, the cache rate decides the bill. An agent that resends a 200,000-token repository on every turn pays the full input price once and the cached price after that, as long as the prefix stays stable. Caching can also shorten time to first token on long prompts, because less work is done before generation starts.

To raise the rate, put stable content first (system prompt, tool definitions, documents) and changing content last. Keep timestamps and request IDs out of the top of the prompt, and keep tool lists in a fixed order. What share of providers’ published prices include a cached-input price, and the typical discount, is in the [LLM API price index](https://broadrouter.com/data/llm-api-price-index/).

## On BroadNet Inference

BroadNet publishes cached input prices for three chat models, per 1M tokens:

| Model | New input | Cached input |
| --- | --- | --- |
| [DeepSeek V4.1 Flash](https://broadrouter.com/models/deepseek-v4.1-flash/) | $0.175 | $0.0055 |
| [GLM 5.3](https://broadrouter.com/models/glm-5.3/) | $0.78 | $0.173 |
| [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/) | $0.175 | $0.0435 |

Cached tokens are billed at the lower price automatically, and `prompt_tokens_details.cached_tokens` shows them when the model reports them. In a stream, request usage with `stream_options` as shown in the [streaming guide](https://broadrouter.com/guides/streaming-chat-completions/).

On a [flat-rate plan](https://broadrouter.com/glossary/flat-rate-llm-plan/) there is no token meter, so the cache rate does not change the bill. The full walkthrough, with code to log your rate, is in [cached input tokens explained](https://broadrouter.com/blog/cached-input-tokens-explained/).

## Questions

### Do cached tokens still count toward the context window?

Yes. Caching changes what you pay for those tokens, not whether they count. Anthropic's docs state this directly.

### How long does a cache last?

It depends on the provider. Anthropic's default lifetime is 5 minutes, refreshed each time the cache is used, with an optional 1-hour lifetime. Other providers do not always publish a fixed time, so measure your hit rate.

### Does caching change the answer?

No. The cache stores work done on the prompt, not the reply. The model still generates a fresh answer.

## See also

-   [Input and output tokens](https://broadrouter.com/glossary/input-and-output-tokens/) (term)
-   [Token](https://broadrouter.com/glossary/token/) (term)
-   [Context window](https://broadrouter.com/glossary/context-window/) (term)
-   [Pay-as-you-go](https://broadrouter.com/glossary/pay-as-you-go/) (term)
-   [KV cache](https://broadrouter.com/glossary/kv-cache/) (term)
-   [System prompt](https://broadrouter.com/glossary/system-prompt/) (term)
-   [Stream chat completions and handle dropped connections](https://broadrouter.com/guides/streaming-chat-completions/) (guide)
-   [Cached input tokens: how to cut an LLM API bill](https://broadrouter.com/blog/cached-input-tokens-explained/) (article)
-   [When a 1M-token context window is worth it (and when not)](https://broadrouter.com/blog/million-token-context-window-guide/) (article)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-cached-input-tokens&utm_content=page-cta) ·

**Sources**

-   [OpenAI, prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
-   [Anthropic, prompt caching (pricing multipliers and cache lifetime)](https://platform.claude.com/docs/en/build-with-claude/prompt-caching)
-   [BroadNet Inference API reference, reasoning and cached tokens](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-cached-input-tokens&utm_content=sources)
-   [BroadNet Inference machine-readable prices (pricing.json)](https://inference.broadnet.ai/pricing.json?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-cached-input-tokens&utm_content=sources)
