Mr. Usage › xAI

Check your xAI balance

Mr. Usage reads xAI's documented usage endpoint with your own key and keeps a card refreshed on its own. Main number: the team's prepaid credit balance in dollars. Details: any amount owed. Postpaid usage and spending limits are not shown. The card needs your team id as a setting.

Install Mr. Usage GitHub repository

What the xAI card shows

Main number: the team's prepaid credit balance in dollars. Details: any amount owed. Postpaid usage and spending limits are not shown. The card needs your team id as a setting. A yellow "Low" badge appears under 20% left and a red "Nearly out" badge under 5%, with a line of today's readings underneath.

Needs a Management API key, not an inference key, plus the team id. Shows prepaid credit only.

What Mr. Usage reads

Call`GET https://management-api.x.ai/v1/billing/teams/<team id>/prepaid/balance`
Authenticationa Management API key (not an inference key) as `Authorization: Bearer <key>`, plus the team id entered in the provider's settings (letters, digits, `-` and `_` only).
Verified againsthttps://docs.x.ai/developers/rest-api-reference/management/billing
Anything else contactedNothing. The host is on a per-provider allowlist checked before every request, redirects are off, and the connection is TLS 1.2 or newer.

The app shows you this exact address before you save a key, and docs/SOURCES.md records where each fact came from and when it was read.

Questions

Does checking my xAI usage cost credits?

the management call is a billing lookup, not inference; the docs list no price and it consumes no credits.

Where does my xAI API key go?

Into your operating system's credential store, under the service name mr-usage: Keychain on macOS, Credential Manager on Windows, the Secret Service on Linux. The app reads it at the moment it calls the vendor, wraps it in a zeroizing type, and drops it. It is never written to a file of the app's own and never sent back to the window.

How often is the card refreshed?

Every 5 minutes by default. Settings lets you pick anything from 1 minute to 24 hours, and changing the interval takes effect from the last poll. There is also a Refresh button on each card, limited to once a minute.

Other providers