Skip to content

feat: price new models by default and explain token totals - #3

Merged
jiunbae merged 1 commit into
mainfrom
feat/pricing-accuracy-and-output-metric
Aug 9, 2026
Merged

feat: price new models by default and explain token totals#3
jiunbae merged 1 commit into
mainfrom
feat/pricing-accuracy-and-output-metric

Conversation

@jiunbae

@jiunbae jiunbae commented Aug 9, 2026

Copy link
Copy Markdown
Member

Fleet reports read as inflated and undercount cost. Verified against raw transcripts on a four-host fleet: the aggregation arithmetic was already exact (host sums == daily rows == totals, no duplicate dates, no cross-host double counting). The problems were in pricing defaults and presentation.

Pricing defaulted to offline

ccusage defaults to offline: false; ccusage-fleet flipped it to true. Every model newer than the pricing snapshot bundled with ccusage was therefore priced at $0 with no indication — 9.7% of tokens (11.9B, mostly claude-opus-5) on the fleet under test. The same day priced $0 offline and $32.14 online.

Default to online pricing to match ccusage. --offline still selects the bundled snapshot.

Total tokens is mostly cache reads

Cache reads were 96.6% of total tokens, because each turn replays the cached context at a fraction of the input rate. Bars scaled by total tokens track context size rather than work and diverge sharply from cost — 2026-07-29 was 5.6B tokens for $1.5K, while 2026-07-15 was 5.3B for $3.8K.

Add --graph-metric output alongside tokens and cost.

Nothing explained any of this

Print Note: lines under the table for the cache-read share, models missing from the pricing table, and the reasoning tokens ccusage folds into totalTokens without giving them a column (0.00034% of the fleet total, from gemini and opencode). --json gains a notes array; schemaVersion is unchanged.

Also bumps ccusage to 20.0.19 to refresh the bundled snapshot for --offline users.

Verification

npm test — 27 pass. On the live fleet, unpriced tokens fall from 9.7% to 0.0%.

🤖 Generated with Claude Code

Fleet reports read as inflated and undercount cost. Three causes, all fixed
here.

Pricing defaulted to offline, unlike ccusage itself, so every model newer
than the snapshot bundled with ccusage was priced at $0 with no indication.
On a four-host fleet that silently dropped 9.7% of tokens (11.9B, mostly
claude-opus-5) out of the cost column. Default to online pricing to match
ccusage; --offline still selects the bundled snapshot.

Total tokens is dominated by cache reads -- 96.6% on the same fleet -- because
every turn replays the cached context. Bars scaled by total tokens therefore
track context size rather than work, and diverge sharply from cost. Add
--graph-metric output alongside tokens and cost.

Print Note: lines under the table covering the cache-read share, models
missing from the pricing table, and the reasoning tokens ccusage folds into
total tokens without a column. --json gains a notes array; schemaVersion is
unchanged.

Also bump ccusage to 20.0.19 to refresh the bundled pricing snapshot.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jiunbae
jiunbae merged commit 9f04526 into main Aug 9, 2026
2 checks passed
@jiunbae
jiunbae deleted the feat/pricing-accuracy-and-output-metric branch August 10, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant