{"version":"2.1.286","anchor":"usage-metering-now-warns-once-on-malformed-upstream-usage-an","canonical_anchor":"usage-metering-now-warns-once-on-malformed-upstream-usage-an","heading":"More accurate token counting when usage data looks wrong","tier":"notice","area":"Elsewhere","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.286\/e\/usage-metering-now-warns-once-on-malformed-upstream-usage-an","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.286","markdown":"### More accurate token counting when usage data looks wrong\n\nClaude Code now warns once when usage data from the API is malformed and counts cache and input tokens more fully\n\n**What**\n\nClaude Code tracks how many tokens (units of text) each request uses so it can work out cost. It gets these counts from the API as the response streams in.\n\n- If the usage data does not match the expected format, Claude Code no longer drops it silently. It logs a warning, once per process, saying spending may be under-counted.\n\n- Later updates in the stream now raise the input, cache read and cache creation counts to the highest value seen. Before, only output tokens and server tool use were copied from those updates.\n\n- If the total for cache creation is missing, Claude Code adds up the 5-minute and 1-hour cache counts instead.\n\n**Why**\n\nCost figures are more accurate, especially when a proxy or gateway sits between Claude Code and the API. The warning tells you when the numbers may be too low.\n\n- Area: Elsewhere\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5"}