Skip to content

v0.7.1: Enable Claude extra usage spend tracking (alpha feature) #19

@danielithomas

Description

@danielithomas

Summary

Claude's extra usage spend data (dollar amounts for usage beyond the subscription cap) is not available via any stable API. The data is visible at claude.ai/settings/usage in the browser but has no documented REST endpoint.

This has been an open question since project inception (OQ-001) and was previously deferred (D-005). With the introduction of enable_alpha_features (D-053 in v0.7.0), we now have a clean mechanism to ship unstable data sources without misrepresenting their reliability.

Scope

  • Implement Claude extra usage spend tracking behind enable_alpha_features = true
  • Investigate available data sources:
    • Undocumented /api/oauth/usage endpoint (OQ-002 — rate-limited, may change)
    • Scraping claude.ai/settings/usage via authenticated request
    • Any new Anthropic endpoints that may have appeared
  • Map extra usage data to a new UsageWindow (e.g. "Extra Usage Spend", unit: "usd")
  • Alpha-sourced windows flagged with alpha: true in extras dict
  • Emit stderr warning on first use: "Claude extra usage tracking is an alpha feature — it relies on undocumented interfaces that may break without notice"
  • Graceful failure — if the data source is unavailable, silently skip (no error in provider output)

Relates to

  • OQ-001 — How to surface Claude extra usage spend data?
  • D-005 — Claude extra usage spend available as alpha feature
  • D-053enable_alpha_features flag for unstable data sources
  • OQ-002 — Is the /api/oauth/usage endpoint stable enough to depend on?
  • OQ-008 — What does utilization > 100 look like in Claude's API?

Acceptance criteria

  • Extra usage spend appears as a UsageWindow when enable_alpha_features = true
  • No effect when enable_alpha_features = false (default)
  • Stderr warning on first use per session
  • Graceful degradation if data source is unavailable
  • Tests with mocked responses (both success and failure paths)
  • README alpha features section updated with Claude extra usage details

Milestone

v0.7.1 (patch release after v0.7.0 Ollama provider)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions