Skip to content

Cursor: toggle between included usage and raw API usage #609

Description

@robinebers

Problem

Cursor tracks two different kinds of usage:

Kind Meaning
Included usage Consumption covered by the plan (CSV Cost column = Included)
Raw API usage Billed on-demand / API usage (CSV Cost column is a dollar amount)

OpenUsage currently mixes both when showing Cursor spend. The Today / Yesterday / Last 30 Days tiles price every CSV row from token counts via the bundled model manifest, ignoring whether Cursor marked the row as included or billed.

That makes the spend tiles misleading for users who only care about one view — e.g. "how much of my included plan did I use today?" vs "how much API/on-demand spend did I rack up?"

Current behavior

  • CursorUsageCSV.parse reads token columns but drops the Cost column (see comment in CursorUsageCSV.swift: actual-cost / CostMode path deferred for v1).
  • CursorUsageMapper.appendSpendLines sums imputedCostDollars across all rows with no filter.
  • Dashboard API metrics (apiPercentUsed, autoPercentUsed, totalPercentUsed) come from Cursor's Connect RPC and are separate from the CSV spend tiles.

Ask

Add a user-facing toggle (Cursor-specific) to choose which usage view to show for spend-related metrics:

  • Included only — aggregate rows where Cost = Included (priced locally from tokens, or $0 if we treat included as non-billable)
  • Raw API only — aggregate rows with an actual dollar Cost from the CSV (or non-Included rows)
  • All usage (default) — current behavior for users who want the combined picture

UX ideas

  • Setting in Settings under a Cursor section, or a compact control on the Cursor provider card
  • Clear labels: e.g. "Included Usage" / "API Usage" / "All Usage"
  • Persist preference per device
  • Spend tiles (Today, Yesterday, Last 30 Days) respect the toggle; document whether bounded metrics (Total Usage %, API Usage %) should also switch or stay as Cursor reports them

Implementation notes

  • Extend CursorUsageCSVRow to carry billing kind (included vs billed) parsed from the Cost column.
  • Thread the preference through CursorProvider → appendSpendLines (and any Tauri plugin parity if still maintained on main).
  • Add tests for mixed CSV rows (some Included, some $1.23) and verify each toggle mode sums correctly.
  • Update docs/providers/cursor.md to explain the toggle and what each mode means.

References

  • Sources/OpenUsage/Providers/Cursor/CursorUsageCSV.swift
  • Sources/OpenUsage/Providers/Cursor/CursorUsageMapper.swift — appendSpendLines
  • Sources/OpenUsage/Providers/Cursor/CursorProvider.swift — spend widget descriptors
  • Prior art: cursorcat UsageCSV.swift CostMode path (dropped in v1 port)
  • Test fixtures in Tests/OpenUsageTests/CursorSpendTests.swift already use Cost = Included

Acceptance

  • User can switch between included-only, raw-API-only, and all-usage views for Cursor spend tiles.
  • Each mode produces correct totals on mixed CSV data.
  • Default preserves today's combined behavior.
  • Documented in docs/providers/cursor.md.

Activity

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

    approvedMaintainer-approved issue or PR scopeenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions