xAI Grok API Credits: Prepaid Balance and Key Setup

Monitor xAI Grok API team prepaid credits using a Management Key and Team ID, with explicit cent units and ledger-sign verification.

Live test reported

Guide updated

A user reported success on September 27, 2026. No independent amount-by-amount console reconciliation was recorded. Zero balances, permission errors, and MCP flows are not fully verified. Sign conversion still follows the official top-up example.

Required credentials
xAI Management Key
Monitoring currency
USD · Converted from signed cents
What is monitored
Team prepaid credit balance
The selected Team ID’s prepaid/balance.total.val in the xAI Management API. Values are USD cents. Following the official negative top-up ledger example, the sign is reversed and the amount divided by 100.

How to check xAI Grok API credits manually

  1. Sign in to the xAI Console and open the team's billing settings to see prepaid credits and payment methods.
  2. Each inference response reports the request's actual cost in usage.cost_in_usd_ticks, where 1 USD = 10,000,000,000 ticks; use it to reconcile spending.
Open official xAI / Grok page(opens in a new tab)

Connect xAI / Grok to Quota Monitor

  1. Copy the correct Team ID

    In the xAI Console for the team you use and top up, open Team Settings and copy Team ID. It is not a project name, model-key ID, or URL. Use separate connections and bindings for different teams.

  2. Create a dedicated Management Key

    Open Settings → Management Keys. Do not use a regular model key. Restrict access to required team billing reads where supported, protect the key, and set expiry.

  3. Add it to your project

    Select xAI / Grok. Enter the Management Key and required Team ID in their separate fields. The one-time credential page saves only the connection; return to the project to enter Team ID and create the binding.

  4. Verify the ledger and displayed amount

    Refresh and check the successful time. The official example records a 1000-cent top-up as -1000; this displays as USD 10. Compare the same team’s prepaid credits and raw ledger amount. Stop relying on a mismatched figure and report only error codes and times.

What Quota Monitor reads from xAI / Grok

  • Credits belong to an xAI team and may be shared by keys and projects. Do not count them repeatedly. A Quota Monitor project ID is not an xAI Team ID.
  • Postpaid spending limits, unsettled charges, key limits, and Grok subscriptions are excluded. Zero prepaid credits do not prove API service has stopped.
  • The sign mapping follows an official response example, not independent live-account reconciliation. Compare the console and raw ledger amount on first use. No top-up endpoint is called.
  • The dashboard shows the latest successful snapshot. Manual refresh queries the provider again but cannot eliminate upstream billing delays. An old balance is not a new result after a failed query.

xAI / Grok FAQ and troubleshooting

Why can I not use a regular Grok API key?
This endpoint belongs to the separate Management API and requires a Management Key. Never share keys in chat or public issues.
How do I resolve 401, 403, or Team ID errors?
For 401, check key validity and expiry. For 403, check billing-read access to the supplied team. Copy the ID from the actual paying team, not a Quota Monitor project. Failure never writes a fabricated zero.
Why do models work with zero prepaid credits?
xAI also has postpaid spending limits. This view covers prepaid credits only, not total payment capacity or key status.
Why does the console differ?
Check Team ID, last successful sync, the prepaid-credit field, and the raw cents shown here. A reported successful test is not detailed reconciliation; postpaid limits are not balances.
Does the xAI API stop when prepaid credits run out?
xAI consumes prepaid credits first and then accrues postpaid usage. The API stops once prepaid credits are used up and postpaid usage reaches the monthly spending limit you set. To use prepaid credits only, set the postpaid limit to 0. xAI's error reference does not list a dedicated out-of-credits status.

Official xAI / Grok references

Prepared by Quota Monitor, not an official provider tutorial. Interfaces and permissions may change; check official pages. Verification is limited to the scope stated here.

Monitor xAI / Grok automatically

Checking a console by hand is easy to forget. Quota Monitor reads xAI / Grok through its official API for you.

  • Refreshes every 10 minutes by default, and you can refresh manually at any time.
  • Low balances, invalid keys, and sync failures appear at the top of your overview.
  • Group accounts by project, and ask about balances from AI assistants such as Claude through remote MCP.
Start for free