# Prefix cache

Concept · [Building with AI](https://ecosystem.samcarlton.com/ai)

Also called: prompt caching, prompt cache, context caching, caching prompts, prefix caching

A provider feature that remembers the opening of a request it has just handled. If your next request starts with the same text, the provider skips reworking it, bills that part at a discount and replies faster. Keeping the start of each request the same, such as the [system prompt](https://ecosystem.samcarlton.com/system-prompt), is what makes it pay off.

**For example:** A support bot begins every request with the same long policy manual. With [caching](https://ecosystem.samcarlton.com/cdn), it pays full price for the manual once and a discounted rate on later requests.

## Connects to (7)

- [Cache tokens](https://ecosystem.samcarlton.com/cache-tokens): Input tokens the provider did not need to process again because they matched the start of a recent request in its cache.
- [Input tokens](https://ecosystem.samcarlton.com/input-tokens): The tokens an AI product sends to the model on each request: the instructions, the conversation so far, files and tool results.
- [System prompt](https://ecosystem.samcarlton.com/system-prompt): Standing instructions that the builder of an AI product gives the model before any user types.
- [Model provider](https://ecosystem.samcarlton.com/model-provider): The company or service that runs an AI model and answers requests to it, usually over the internet through an API.
- [Model provider request](https://ecosystem.samcarlton.com/model-provider-request): One trip from an AI product to the model provider and back.
- [Usage-based pricing](https://ecosystem.samcarlton.com/usage-based-pricing): A way to charge where the bill follows how much the customer uses, instead of a flat fee.
- [Startup ecosystem](https://ecosystem.samcarlton.com/startup-ecosystem): The people, money and organizations in one place that help new companies start and grow.

## Sources

- <https://platform.claude.com/docs/en/build-with-claude/prompt-caching>


Map view: https://ecosystem.samcarlton.com/prefix-cache
