Skip to content

Usage and rate-limit API #675

Open

Description

@Splaxi

Feature Description

I would like to have some kind of API to expose my accounts current spending, usage, and rate limits.

Use Case

Using different tools with my GOAT plan, I would like for them to be able to extract my spending, so I can plan around my consumption.

Additional Context

No response

How important is this to you?

None

Activity

  1. added theissue type on Aug 13, 2026
  2. vipulgupta2048 commented on Aug 13, 2026

    @vipulgupta2048
    Member

    Thanks for opening an issue @Splaxi What's lacking in the studio > Usage dashboard that we might improve to give you the insights you need?

  3. Splaxi commented on Aug 13, 2026

    @Splaxi
    Author

    I'm using different tools around the provider api and it breaks my process that I have to visit the website or open the cmd cli - to see the details.

  4. hwong103 commented on Sep 18, 2026

    @hwong103

    Adding the concrete gap here, since this is exactly the case I hit: a local harness calling the provider API with my key.

    What the provider API already exposes today

    • GET /alpha/billing/credits → credits.monthlyCredits (remaining), purchasedCredits, freeCredits, plus windowLimits.fiveHour and windowLimits.weekly as { used, cap, resetAt }
    • GET /alpha/billing/subscriptions → planId, status, quantity, currentPeriodEnd
    • GET /alpha/usage/summary → totalMonthlyCredits, periodBasis: "billing-period"

    That's enough to reproduce the 5-hour and weekly bars exactly, because those are just used / cap.

    What's missing: the monthly denominator.

    Studio renders a Monthly Limit bar beside the other two, but its percentage isn't a windowLimits entry — it's derived:

    total = max(monthlyCreditsGranted, tier.limits.totalCredits)  // x seatQuantity for org plans
    pct   = round((total - monthlyCreditsRemaining) / total * 100)

    monthlyCreditsGranted is read off the credits response in the web client, but /alpha/billing/credits does not return it, so total falls back to a plan table that only exists in the web bundle (GOAT = totalCredits: 70). A provider-API client has to hardcode your price table to show the same number, and it drifts the moment plans or per-account grants change.

    Worth noting that the two endpoints don't currently agree exactly on a GOAT account: credits.monthlyCredits plus usage/summary.totalMonthlyCredits implies a grant of about $71.37 against the published $70, which is another reason a client shouldn't be deriving this figure itself. (Related: #761 reports the same bar disagreeing with its own dollar figures.)

    Ask: expose the grant on the provider API — either credits.monthlyCreditsGranted on /alpha/billing/credits, or a windowLimits.monthly entry alongside fiveHour and weekly. The second matches the shape you already ship and would make the monthly bar a straight used / cap like the other two. No new endpoint required either way, and happy to test a preview field if you'd rather gate it.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions