Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/prompt-caching-openai-api-workflow-guide.mdA 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.textA 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.textA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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