Skip to content

Add billing: "subscription" config option to suppress inflated costs for flat-fee plans #1280

Description

@jnelken

What do you want to change?

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)
  • --mode display — returns cost_usd ?? 0.0; since Claude Code dropped costUSD from JSONL in v1.0.9 (Claude Code 1.0.9 no longer reports the costUSD field #4), this returns $0 for everyone, not just subscription users
  • 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.

Activity

  1. pullfrog commented on Jun 11, 2026

    @pullfrog
    Contributor
  2. github-actions commented on Jun 11, 2026

    @github-actions
    Contributor

    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.

    See CONTRIBUTING.md.

  3. ryoppippi commented on Aug 31, 2026

    @ryoppippi
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriage:maintainableFits the repository's maintainable scope and needs review.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions