API / explore-api-usage-in-xai-console

API

Explore API usage in the xAI Console

Open Usage Explorer when you need to watch team API consumption across keys and models, catch spend spikes early, or explain a billing cycle without writing scripts first. Official Usage Explorer documents the Console surface for team admins: granularity controls, dimension switches among USD cost, tokens, and billing items, group-by comparisons, and filters for API key, model, request IP, cluster, or token type. The Manage Billing guide points prepaid teams at the same Usage explorer page for day-to-day monitoring after credits land. Start at console.x.ai on the team whose spend you own.

What you need

A Console login with team-admin access on the correct team in the picker, a billing period or date range you care about, and a clear question such as “which API key burned credits yesterday” or “did tokens spike on one model.” Prepaid purchase and auto top-up stay on Billing; this job is read-only exploration. When automation must pull the same history over HTTP, use Get usage analytics via the xAI Management API. Neighboring Console spend jobs include Purchase prepaid credits on the xAI Console and Set auto top-up on the xAI Console. More API jobs live on the API hub.

Read consumption in Usage Explorer

  1. Sign in to console.x.ai and confirm the team picker shows the team whose usage you intend to inspect before you open Usage Explorer.
  2. Open the Usage Explorer page from the Console navigation for that team.
  3. Set Granularity to match the question. Official docs show daily credit consumption with Granularity: Daily when you want a day-by-day cost curve.
  4. Leave the default dimension on cost in USD for spend review, or open Dimension and choose Tokens or Billing items when you need volume or item counts instead of dollars.
  5. Apply Group by when you need side-by-side series. Docs walk through grouping by API Key to compare test versus production keys on the same chart.
  6. Open Filters when the basic chart is too wide. Documented filter options include a particular API key, a model, a request IP, a cluster, and the token type. Combine filters until the remaining series answers the incident or finance ask.

Refresh after large prepaid purchases or limit changes so the explorer reflects the window you are explaining. Export or screenshot only what your internal retention policy allows; treat key identifiers and request IPs as sensitive ops data.

Tie explorer views to billing actions

When daily USD climbs toward an invoiced billing limit, move from explorer into Billing and raise or tighten limits with the same team selected, following Set postpaid spending limits via the xAI Management API if you change limits over HTTP. When one API key dominates the group-by view, rotate or disable that key with Rotate or disable an xAI API key after you confirm the traffic is unintended. Prepaid balance checks for automation stay on Check prepaid credit balance via the xAI Management API.

Pitfalls

Exploring the wrong team in the picker attributes another project’s keys and models to your incident write-up. Reading token dimension as if it were USD understates or overstates cost when unit prices differ by model. Skipping filters on a high-cardinality team buries the noisy key under an aggregate that looks healthy. Mixing SuperGrok consumer usage screens on grok.com with this Console Usage Explorer produces conflicting stories for finance because they meter different products.