Skip to content

feat(xai): track OAuth quotas in dashboard#2672

Open
fenix007 wants to merge 1 commit into
decolua:masterfrom
fenix007:feat/xai-quota-tracking
Open

feat(xai): track OAuth quotas in dashboard#2672
fenix007 wants to merge 1 commit into
decolua:masterfrom
fenix007:feat/xai-quota-tracking

Conversation

@fenix007

Copy link
Copy Markdown

Summary

  • enable Quota Tracker for xAI OAuth connections using the Grok billing and subscription endpoints
  • reuse the existing Grok CLI quota parser while keeping provider-specific error messages
  • preserve remaining percentages for xAI quota bars and show the active plan when no numeric allotment is exposed

Why this works

The xAI OAuth grant already includes the grok-cli:access scope. A read-only check with a real xAI OAuth connection returned HTTP 200 from both /v1/billing?format=credits and /v1/user?include=subscription. No token or account identifiers are included in this PR.

API-key xAI connections remain excluded from Quota Tracker; only OAuth connections are eligible.

Validation

  • npx vitest run unit/grok-cli-usage.test.js unit/usage-dispatch.test.js: 19 passed
  • full non-live suite: 1303 passed / 45 existing failures; clean origin/master: 1298 passed / the same 45 failures
  • npm run build
  • targeted ESLint: no errors
  • provider OAuth URL baseline: unchanged

Behavior

Accounts with on-demand or prepaid credit data render quota bars. Paid subscription accounts whose billing response does not expose a numeric included quota render the detected plan plus the existing explanatory message instead of inventing a limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant