Prompt caching

Prompt caching reuses the processed prefix of repeated prompts, cutting cost and latency on subsequent calls.

If your system prompt and retrieved context are stable, caching can reduce input cost by most of its value and shorten time-to-first-token. Put the stable material at the front of the prompt so the cacheable prefix is as long as possible.

All AI terms