1-hour cache write cost undercounted by 37.5%: Claude
Quick fix
Update Claude Code to a version containing this fix so 1-hour cache writes are billed at 1.6 times the 5-minute cache write rate.
Symptom
Section titled “Symptom”全部写入都按定价表的缓存写入单价计费:1000 × $6.25/M = **$0.00625**。内置 Claude 定价行填的是 5 分钟价,所以 1h 写入少算 37.5%。All writes are billed at the cache write rate in the pricing table: 1000 × $6.25/M = **$0.00625**. The built-in Claude pricing row uses the 5-minute rate, so 1-hour writes are undercounted by 37.5%.
Claude responses and session imports read only the aggregate field `cache_creation_input_tokens` and do not distinguish between `ephemeral_5m_input_tokens` and `ephemeral_1h_input_tokens` in `usage.cache_creation`. As a result, cost calculations bill all cache writes at the 5-minute cache write rate, while 1-hour cache writes should be calculated at 1.6 times that rate.
Use a CC Switch version containing this fix; the issue says only that the fix and regression tests were written, and does not provide a released version number.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
(No FAQ yet)
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.