openai · OpenAI Platform Docs
Prompt caching | OpenAI API
Explains how to implement prompt caching to reduce latency and costs by reusing frequently used context in API requests.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Prompt caching | OpenAI API
Explains how to implement prompt caching to reduce latency and costs by reusing frequently used context in API requests.
When To Use
Use when you need to reduce API costs and latency for long-context prompts or repetitive input patterns.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/prompt-caching-openai-api-workflow-guide.md | A guide explaining how OpenAI implements prompt caching to reduce latency and costs for repetitive prompt content. | Questions about a guide explaining how OpenAI implements prompt caching to reduce latency and costs for repetitive prompt content. |
examples/prompt-caching-openai-api-openai-api-prompt-caching.text | A text example demonstrating the structure of a prompt caching request including model and retention parameters. | Exact payloads, commands, or snippets shown in A text example demonstrating the structure of a prompt caching request including model and retention parameters. |
examples/prompt-caching-openai-api-openai-api-prompt-caching-usage-response.text | A text representation of an OpenAI API response object showing the prompt_tokens_details field with cached token counts. | Exact payloads, commands, or snippets shown in A text representation of an OpenAI API response object showing the prompttokensdetails field with cached token counts. |
What This Skill Covers
- Model prompts often contain repetitive content, like system prompts and common instructions. OpenAI routes API requests to servers that recently processed th...
- Main sections:
Structuring prompts,How it works,Prompt cache retention,In-memory prompt cache retention,Extended prompt cache retention.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/prompt-caching
