{"version":"2.1.286","anchor":"cache-ttl-and-usage-accounting-use-cache-creation-breakdown","canonical_anchor":"cache-ttl-and-usage-accounting-use-cache-creation-breakdown","heading":"Usage accounting reads cache writes split by 5-minute and 1-hour lifetime","tier":"internal","area":"Prompt Cache","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.286\/e\/cache-ttl-and-usage-accounting-use-cache-creation-breakdown","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.286","markdown":"### Usage accounting reads cache writes split by 5-minute and 1-hour lifetime\n\nClaude Code now reads the API's cache_creation breakdown, tells 5m and 1h cache writes apart, and uses it for cache lifetime decisions\n\n**Unclear.** What the new fallback rule for the main conversation returns is not clear.\n\n**What**\n\nWhen Claude Code sends a request, it can store part of the conversation in a prompt cache so later requests are faster and cheaper. Cached entries last either 5 minutes or 1 hour. The API's usage report can now say how many cached tokens were written at each lifetime, and Claude Code reads that.\n\n- The usage format now accepts a `cache_creation` object holding `ephemeral_5m_input_tokens` and `ephemeral_1h_input_tokens`.\n\n- The cache fields and `server_tool_use` may now be missing or empty without causing a problem.\n\n- When usage from several responses is combined, `cache_creation` is kept, and `cache_creation_input_tokens` is worked out from it.\n\n- A new check reports whether the cache lifetime was `1h` or `5m` from these counts.\n\n- The fallback that picks the cache lifetime for the main conversation now calls a function. Before, it chose `1h` for the main thread and `5m` otherwise.\n\n- Each usage record now carries `cache_creation_5m_input_tokens` and `cache_creation_1h_input_tokens`, each 0 when not reported.\n\n**Why**\n\nThe cache lifetime is now taken from what the API reported rather than assumed. That feeds Claude Code's decisions about cache misses and keeping the cache alive, and it lets the cost of cache writes be split by lifetime.\n\n- Area: Prompt Cache\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 2\/5"}