Skip to content

[FEATURE]: Add Go plan usage/balance API endpoint (rolling/weekly/monthly windows) #16017

Description

@StephanMeijer

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Summary

Expose the Go plan subscription usage data via a public API endpoint. The dashboard already shows this information — rolling, weekly, and monthly usage percentages with reset timers — but there is no way to query it programmatically.

Use Case

  • Status bar widgets (waybar, polybar, macOS menu bar) showing current usage
  • Alerts when approaching plan limits before getting throttled
  • Monitoring dashboards aggregating usage across providers and plans
  • CI/CD pipelines checking remaining quota before kicking off expensive runs

Current Behavior

The only way to see Go plan usage is the web dashboard, which displays:

  • Rolling usage: x% (resets in N minutes)
  • Weekly usage: y% (resets in N minutes)
  • Monthly usage: z% (resets in N minutes)

No API endpoint exists to retrieve this data.

Proposed API

GET /api/v1/usage/plan
Authorization: Bearer <api-key>

Response:
{
  "plan": "go",
  "windows": {
    "rolling": {
      "usage_percent": 65,
      "resets_in_seconds": 2520
    },
    "weekly": {
      "usage_percent": 30,
      "resets_in_seconds": 259200
    },
    "monthly": {
      "usage_percent": 12,
      "resets_in_seconds": 1728000
    }
  }
}

Related Issues

Additional Context

The Go plan's rolling/weekly/monthly usage windows are a distinct data model from the Zen credit balance (#10448) and provider-level quotas (#9281). The server already computes this data for the dashboard, so exposing it via API should be a relatively small addition.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions