<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/monitor-prompt-caching-to-optimize-your-token-usage-bwzwycrgn" -->

---
title: Monitor prompt caching to optimize your token usage
description: System prompts now account for a large and growing share of LLM input tokens as agent scaffolding expands, making prompt caching a key lever for reducing cost...
canonical: https://daily.dev/posts/monitor-prompt-caching-to-optimize-your-token-usage-bwzwycrgn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Monitor prompt caching to optimize your token usage | daily.dev
og:description: System prompts now account for a large and growing share of LLM input tokens as agent scaffolding expands, making prompt caching a key lever for reducing cost...
og:url: https://daily.dev/posts/monitor-prompt-caching-to-optimize-your-token-usage-bwzwycrgn
og:image: https://api.daily.dev/og/posts/BWZWycrgn.png
og:image:alt: Monitor prompt caching to optimize your token usage
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.

# Monitor prompt caching to optimize your token usage

**[Datadog](https://daily.dev/sources/datadog)** · 8 min read · 0 upvotes · 0 comments

## Summary

System prompts now account for a large and growing share of LLM input tokens as agent scaffolding expands, making prompt caching a key lever for reducing cost and latency. Anthropic and OpenAI implement caching differently: Anthropic supports automatic and explicit cache_control breakpoints on tools/system/messages, while OpenAI auto-caches prompts of 1,024+ tokens and adds explicit prompt_cache_breakpoint support on GPT-5.6 and newer. Cache writes cost more than uncached input (Anthropic charges 1.25x for a five-minute write, 2x for a one-hour write, and 0.1x for a read), so unstable prefixes can increase costs. Common cache busters include changing tool order, context compaction, and injecting timestamps or request IDs into tool definitions. Monitoring cache_creation_input_tokens, cache_read_input_tokens, cached_tokens, and cache_write_tokens alongside traces helps teams diagnose these issues and validate caching setups before production.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.datadoghq.com/blog/monitor-prompt-caching-optimize-token-usage>

## Questions this post answers

### How does Anthropic's prompt caching pricing work compared to a regular cache read?

Anthropic charges a premium for writing to the cache but a steep discount for reading from it: 1.25 times the base input rate for a five-minute cache write, 2 times the base rate for a one-hour write, and only 0.1 times the base rate for a cache read. This makes a cached prefix roughly 90% cheaper to reuse, though a single cache hit within five minutes can offset the initial write premium.

_Teams tuning LLM cost budgets can track caching guidance like this on daily.dev._

### What causes prompt cache invalidation in an LLM agent system?

Cache invalidation typically happens when anything inside the cached prefix changes, even slightly. Common causes include tool definitions being serialized in a different order between requests, context compaction that summarizes and overwrites conversation history, and injecting per-request metadata like timestamps or request IDs into otherwise static tool descriptions.

_Developers debugging agent latency and cost spikes can follow this kind of troubleshooting detail on daily.dev._

### At what prompt size does OpenAI automatically cache requests?

OpenAI automatically caches prompts of 1,024 tokens or more with no code changes required, routing eligible requests to a server that recently handled the same prefix and billing the matching portion as a cheaper cache read. On GPT-5.6 and newer models, OpenAI also supports explicit cache breakpoints via a prompt_cache_breakpoint field on individual content blocks.

_Engineers optimizing OpenAI API costs can keep track of caching behavior like this via daily.dev._

## Similar posts on daily.dev

- [Prompt Caching for Anthropic and OpenAI Models: Building Cost-Efficient AI Systems](https://daily.dev/posts/prompt-caching-for-anthropic-and-openai-models-building-cost-efficient-ai-systems-mjzh92xkq) · DigitalOcean · 2 upvotes · 0 comments
- [Prompt Caching Explained](https://daily.dev/posts/prompt-caching-explained-mhomvre8o) · DigitalOcean Community · 2 upvotes · 0 comments
- [The Hidden Cache You’re Paying For But Not Using](https://daily.dev/posts/the-hidden-cache-you-re-paying-for-but-not-using-0w5qklioj) · Medium · 0 upvotes · 0 comments
- [How Does Prompt Caching Work and When Does It Actually Cut LLM Costs?](https://daily.dev/posts/how-does-prompt-caching-work-and-when-does-it-actually-cut-llm-costs--vnardpi3a) · DigitalOcean Community · 1 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/monitor-prompt-caching-to-optimize-your-token-usage-bwzwycrgn)

```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":"Monitor prompt caching to optimize your token usage","url":"https://daily.dev/posts/monitor-prompt-caching-to-optimize-your-token-usage-bwzwycrgn","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/monitor-prompt-caching-to-optimize-your-token-usage-bwzwycrgn"},"datePublished":"2026-09-02T22:03:04.127Z","dateModified":"2026-09-03T00:23:45.387Z","description":"System prompts now account for a large and growing share of LLM input tokens as agent scaffolding expands, making prompt caching a key lever for reducing cost...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/774f46a5cbd65a643de5fb6d3f625146?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/774f46a5cbd65a643de5fb6d3f625146?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Datadog","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":"Datadog","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/8f9d7e3e4bd64bd7b9db9b2ea83e0c6a","url":"https://daily.dev/sources/datadog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/monitor-prompt-caching-to-optimize-your-token-usage-bwzwycrgn","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,openai,anthropic,ai-inference,llm-observability","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Datadog","item":"https://daily.dev/sources/datadog"},{"@type":"ListItem","position":3,"name":"Monitor prompt caching to optimize your token usage"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/monitor-prompt-caching-to-optimize-your-token-usage-bwzwycrgn#faq","mainEntity":[{"@type":"Question","name":"How does Anthropic's prompt caching pricing work compared to a regular cache read?","acceptedAnswer":{"@type":"Answer","text":"Anthropic charges a premium for writing to the cache but a steep discount for reading from it: 1.25 times the base input rate for a five-minute cache write, 2 times the base rate for a one-hour write, and only 0.1 times the base rate for a cache read. This makes a cached prefix roughly 90% cheaper to reuse, though a single cache hit within five minutes can offset the initial write premium. Teams tuning LLM cost budgets can track caching guidance like this on daily.dev."}},{"@type":"Question","name":"What causes prompt cache invalidation in an LLM agent system?","acceptedAnswer":{"@type":"Answer","text":"Cache invalidation typically happens when anything inside the cached prefix changes, even slightly. Common causes include tool definitions being serialized in a different order between requests, context compaction that summarizes and overwrites conversation history, and injecting per-request metadata like timestamps or request IDs into otherwise static tool descriptions. Developers debugging agent latency and cost spikes can follow this kind of troubleshooting detail on daily.dev."}},{"@type":"Question","name":"At what prompt size does OpenAI automatically cache requests?","acceptedAnswer":{"@type":"Answer","text":"OpenAI automatically caches prompts of 1,024 tokens or more with no code changes required, routing eligible requests to a server that recently handled the same prefix and billing the matching portion as a cheaper cache read. On GPT-5.6 and newer models, OpenAI also supports explicit cache breakpoints via a prompt_cache_breakpoint field on individual content blocks. Engineers optimizing OpenAI API costs can keep track of caching behavior like this via daily.dev."}}]}
```

