Files
fusion/packages
gsxdsm bd0e99b31f FN-7814: add xAI/Grok usage card to the Usage dropdown
Adds a Grok (xAI) provider fetcher to the dashboard's usage aggregation so a Grok card now appears in the Usage dropdown when credentials are configured.
- Add fetchGrokUsage() in usage.ts: resolves the API key from GROK_API_KEY env, then ~/.grok/user-settings.json, then grok-cli auth storage, and validates it against GET https://api.x.ai/v1/api-key
- Since xAI exposes no subscription usage meter for inference keys, the card reports auth-validity status (ok/no-auth/error) with an empty usage-window list rather than fabricating quota data
- Surfaces clear error messages for expired/blocked keys and non-200 responses; omits the card entirely when no credentials are found
- Register fetchGrokUsage in fetchAllProviderUsage's parallel provider fetch list alongside Claude, Codex, Gemini, Minimax, Zai, and GitHub Copilot
- Add extensive test coverage in usage.test.ts for key-source precedence, ok/error/no-auth states, and blocked/expired key handling
- Add changeset (.changeset/fn-7814-grok-usage.md) documenting the new minor feature

Files changed:
 .changeset/fn-7814-grok-usage.md               |   7 ++
 packages/dashboard/src/__tests__/usage.test.ts | 157 +++++++++++++++++++++++++
 packages/dashboard/src/usage.ts                |  95 ++++++++++++++-
 3 files changed, 257 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-7814

Fusion-Task-Lineage: cac497a9-5a57-4ba5-a7ea-8a01b89a0cbd

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-11 00:01:10 -07:00
..
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-10 23:42:10 -07:00
2026-07-08 16:27:10 -07:00