<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/prompt-caching-for-anthropic-and-openai-models-building-cost-efficient-ai-systems-mjzh92xkq" -->

---
title: Prompt Caching for Anthropic and OpenAI Models: Building...
description: Prompt caching is an optimization technique that stores repeated prompt segments (system instructions, tool schemas, RAG documents) so they aren't reprocessed...
canonical: https://daily.dev/posts/prompt-caching-for-anthropic-and-openai-models-building-cost-efficient-ai-systems-mjzh92xkq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Prompt Caching for Anthropic and OpenAI Models: Building Cost-Efficient AI Systems | daily.dev
og:description: Prompt caching is an optimization technique that stores repeated prompt segments (system instructions, tool schemas, RAG documents) so they aren't reprocessed...
og:url: https://daily.dev/posts/prompt-caching-for-anthropic-and-openai-models-building-cost-efficient-ai-systems-mjzh92xkq
og:image: https://api.daily.dev/og/posts/Mjzh92xKq.png
og:image:alt: Prompt Caching for Anthropic and OpenAI Models: Building Cost-Efficient AI Systems
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt Caching for Anthropic and OpenAI Models: Building Cost-Efficient AI Systems

**[DigitalOcean](https://daily.dev/sources/do)** · 7 min read · 2 upvotes · 0 comments

## Summary

Prompt caching is an optimization technique that stores repeated prompt segments (system instructions, tool schemas, RAG documents) so they aren't reprocessed on every LLM request. Both Anthropic and OpenAI support it, though differently: Anthropic uses explicit cache_control markers with configurable TTLs, while OpenAI handles caching automatically with optional prompt_cache_key and prompt_cache_retention parameters. Using a Kubernetes troubleshooting assistant as an example, the post shows that caching ~6,000 of 6,350 input tokens reduces per-request cost by ~68%, translating to over $200K/month in savings at 1M daily requests. Best practices include placing all static content (instructions, tool schemas, docs) at the prompt prefix and dynamic content (user queries, conversation history) at the end. DigitalOcean supports prompt caching for both providers using their standard per-token pricing.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.digitalocean.com/blog/prompt-caching-with-digital-ocean>

## Similar posts on daily.dev

- [Prompt Caching Explained](https://daily.dev/posts/prompt-caching-explained-mhomvre8o) · DigitalOcean Community · 2 upvotes · 0 comments
- [Prompt Caching Techniques](https://daily.dev/posts/prompt-caching-techniques-rlnexmcrg) · PromptLayer Blog · 1 upvotes · 0 comments
- [Monitor prompt caching to optimize your token usage](https://daily.dev/posts/monitor-prompt-caching-to-optimize-your-token-usage-bwzwycrgn) · Datadog · 0 upvotes · 0 comments
- [Prompt Caching 2026: Anthropic vs OpenAI vs Gemini Guide](https://daily.dev/posts/prompt-caching-2026-anthropic-vs-openai-vs-gemini-guide-englhxyp8) · Alex CloudStar · 0 upvotes · 0 comments

---

Tags: [#ai-inference](https://daily.dev/tags/ai-inference), [#anthropic](https://daily.dev/tags/anthropic), [#finops](https://daily.dev/tags/finops), [#llm](https://daily.dev/tags/llm), [#openai](https://daily.dev/tags/openai)

[View this post on daily.dev](https://daily.dev/posts/prompt-caching-for-anthropic-and-openai-models-building-cost-efficient-ai-systems-mjzh92xkq)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Prompt Caching for Anthropic and OpenAI Models: Building Cost-Efficient AI Systems","url":"https://daily.dev/posts/prompt-caching-for-anthropic-and-openai-models-building-cost-efficient-ai-systems-mjzh92xkq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/prompt-caching-for-anthropic-and-openai-models-building-cost-efficient-ai-systems-mjzh92xkq"},"datePublished":"2026-03-17T22:00:02.216Z","dateModified":"2026-10-15T02:21:48.185Z","description":"Prompt caching is an optimization technique that stores repeated prompt segments (system instructions, tool schemas, RAG documents) so they aren't reprocessed...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f1f1a9d7e07e6241d5f62227970d7645?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f1f1a9d7e07e6241d5f62227970d7645?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"DigitalOcean","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DigitalOcean","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/6e35e88c18054e53b548b4795beb6167","url":"https://daily.dev/sources/do"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/prompt-caching-for-anthropic-and-openai-models-building-cost-efficient-ai-systems-mjzh92xkq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-inference,anthropic,finops,llm,openai","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DigitalOcean","item":"https://daily.dev/sources/do"},{"@type":"ListItem","position":3,"name":"Prompt Caching for Anthropic and OpenAI Models: Building Cost-Efficient AI Systems"}]}
```

