Prompt Caching in the API
OpenAI
OpenAI now auto-discounts API calls when your prompt overlaps with one it just processed. Repeat big prompts (like long system instructions) and you pay less, get answers faster, no code changes needed.
Based on reporting by OpenAI — read the original for the full story.
Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error
OpenAI quietly flipped a switch that should make a lot of developers' bills smaller without them lifting a finger. The company's new prompt caching feature in the API automatically gives a 50% discount on input tokens that match the beginning of a prompt the model recently processed. No special flag, no new parameter, no rewritten integration — it just happens in the background the moment your prompt crosses 1,024 tokens.
The mechanics are straightforward once you see them. If you're sending the same lengthy system prompt, few-shot examples, or document context over and over — the kind of setup common in coding assistants, RAG pipelines, or chatbots with persistent instructions — the overlapping portion gets treated as a cache hit. OpenAI keeps that prefix warm for 5 to 10 minutes after its last use, and during off-peak hours that window can stretch out to an hour. Miss the window and the cache clears; the next call just pays full price and starts building a new cache.
This rollout covers GPT-4o, GPT-4o mini, o1-preview, and o1-mini, including their dated snapshot versions, plus fine-tuned variants of those models. It works across text, images, tool definitions, and structured outputs, which means the discount isn't limited to plain chat completions — anyone running agents with heavy tool schemas or vision inputs benefits too.
What's notable here isn't the discount percentage so much as the friction OpenAI removed. Competing caching schemes elsewhere often require explicit cache keys or manual prompt restructuring, which developers tend to skip because it's extra work for uncertain payoff. By making it automatic and invisible, OpenAI is betting that most production traffic already has enough repeated structure — system prompts, retrieval templates, tool specs — to make the savings add up without anyone touching their code.
My take — AI-written commentary, not fact-checked reporting
This is the kind of feature that matters more than any benchmark chart: OpenAI just made its API meaningfully cheaper for the exact workloads — agents, RAG, coding tools — that are pushing token usage through the roof. Automatic and free to enable is the right call, and it quietly raises the bar for every other lab still asking developers to manage caching by hand.
Read more about this at: OpenAI