You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add billing: "subscription" config option to suppress inflated costs for flat-fee plans #1280
Add a billing key to ccusage.json with two values: "api" (default, existing behaviour) and "subscription" (forces all costs to $0.00).
Why?
Users on Claude Team / Max / Pro subscriptions pay a flat monthly fee. Their real marginal cost is $0. When they run ccusage, it multiplies their token counts by model pricing tables and shows large dollar amounts that don't reflect reality — there is no API bill being generated.
The current workarounds don't work:
service_tier field — always "standard" for both API and subscription accounts; not a usable signal (confirmed by scanning 44k+ JSONL entries from a Claude Team account)
Any other JSONL field — billing type is simply not recorded in local JSONL files
This came up in #658 (subscription users want block-based display; maintainer said "send a PR") and #1112 (Hermes subscription billing showed $0, same class of problem).
How?
Add billing as a top-level key on CcusageConfig with an enum of "api" | "subscription". When "subscription" is set, an internal CostMode::Subscription is activated that short-circuits all cost calculations to 0.0 without requiring pricing data to be loaded.
I want to implement this change and will open a PR if approved.
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.
Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: maintainable candidate. The request fits the current ccusage scope and can be evaluated with repository-owned code or fixtures, without vendor credentials or platform-specific release infrastructure. It remains closed for now; reopen only after confirming current relevance and expected behavior.
What do you want to change?
Add a
billingkey toccusage.jsonwith two values:"api"(default, existing behaviour) and"subscription"(forces all costs to$0.00).Why?
Users on Claude Team / Max / Pro subscriptions pay a flat monthly fee. Their real marginal cost is
$0. When they runccusage, it multiplies their token counts by model pricing tables and shows large dollar amounts that don't reflect reality — there is no API bill being generated.The current workarounds don't work:
service_tierfield — always"standard"for both API and subscription accounts; not a usable signal (confirmed by scanning 44k+ JSONL entries from a Claude Team account)--mode display— returnscost_usd ?? 0.0; since Claude Code droppedcostUSDfrom JSONL in v1.0.9 (Claude Code 1.0.9 no longer reports the costUSD field #4), this returns$0for everyone, not just subscription usersThis came up in #658 (subscription users want block-based display; maintainer said "send a PR") and #1112 (Hermes subscription billing showed $0, same class of problem).
How?
Add
billingas a top-level key onCcusageConfigwith an enum of"api"|"subscription". When"subscription"is set, an internalCostMode::Subscriptionis activated that short-circuits all cost calculations to0.0without requiring pricing data to be loaded.I want to implement this change and will open a PR if approved.