AI API · Integration · New in 0.9.0

xAI Grok API cost tracking: daily spend per model

See what the Grok API costs your team each day and per model, next to what you pay OpenAI, Anthropic and the rest.

What Burnstack tracks

  • Billed USD per day for each product and model (for example Chat grok-4-0709), from the xAI Management API: the same data as the console's Usage Explorer (xAI docs)
  • Days in UTC
  • The last 90 days on the first sync

Alerts

  • Vendor spend spike: a day above 2.5× xAI's 14-day median

The key you'll need

A management key, created in the xAI console under Settings → Management Keys (xAI docs). Inference API keys can't read billing. A management key can also manage your API keys and billing settings, and xAI doesn't document a read-only one, so Burnstack keeps it in your keychain and only reads usage with it. A key scoped to an organization needs the team in front: TEAM_ID:KEY.

Burnstack checks the key with xAI, shows the account it belongs to when xAI lets the key see it, and stores it in your computer's keychain (macOS Keychain or Windows Credential Manager). It only reads billing and usage.

Connect it: xAI

About 2 minBilled

Need

  • Key: Management key
  • Plan: Any team with API usage.
  • Permissions: Management key for the team (no read-only option is documented) not yet verified

In the xAI console, open Settings → Management Keys and create a management key (inference API keys can't read billing). Management keys can also manage API keys and billing settings, and xAI doesn't document a read-only one, though Burnstack only reads usage. A key scoped to an organization needs the team: TEAM_ID:KEY. Burnstack reads the team's daily spend per model, the same data as the console's Usage Explorer.

Steps not yet verified

Open xAI's key page ↗

  1. In the xAI console, open Settings → Management Keys.
  2. Create a management key named Burnstack for the team you want to track.
  3. Copy the key (shown once).
  4. Paste it into Burnstack (for an organization-scoped key: TEAM_ID:KEY).

Paste it

In Burnstack: Connectors → xAI → Add key → paste → Validate & save. The key goes straight into your computer's keychain.

If it fails

This management key is scoped to an organization
Paste TEAM_ID:KEY with the team to track.
xAI API error 401 not yet verified
The key was revoked or is an inference API key. Create a management key under Settings → Management Keys.

Let your AI do the clicking not yet verified

Paste this into an AI assistant that can use your browser, such as Claude in Chrome. It opens xAI's key page and sets only the permissions above, then stops before the final button that creates the key.

Open https://console.x.ai/ in my browser. Go to Settings → Management Keys and start creating a management key named 'Burnstack' for my team. If the form offers permissions, choose only what reads billing or usage. xAI has no expiry setting for this key, so skip that. Stop before clicking 'Create' (the final button that creates the key) and tell me it's ready. I'll click it, copy the key and paste it into Burnstack myself. Don't copy, read or paste the key, and don't grant broader access or change any other setting. If xAI asks me to sign in or confirm with 2FA, wait for me.

The key never passes through the AI: you click that last button yourself, copy the key and paste it into Burnstack.

What you'll see

  • Billed: Billed cost, as xAI charges it.
  • History: Not documented; the first sync asks for 90 days. not yet verified
  • Delay: Same data as Usage Explorer; today's figure grows as you use the API.

Good to know

  • Cost only: token counts aren't shown yet.
  • The team has no display name in xAI's API, so Burnstack shows the key's name.
  • Today's figure grows as you use the API.
  • The per-model AI spike alert doesn't cover xAI yet; the vendor spike alert does.
Burnstack Connectors, Add cost source tab: a search box, category filters and one card per vendor with its key steps

One bill, not a dashboard per vendor

Burnstack puts xAI next to the rest of your spend and lets you group it by product with applications. Other integrations: Vercel, Neon, Supabase, OpenAI, Anthropic, GitHub, OpenRouter, DigitalOcean, Twilio, Stripe fees, Cloudflare, Netlify, AWS, Datadog, Sentry, Cursor, PlanetScale, Azure, Google Cloud, MongoDB Atlas, Railway, Render, Heroku, Akamai (Linode), Vultr, Fastly, Runpod, Together AI, fal.ai, Runway, Upstash.

xAI questions

Why does Burnstack need an xAI management key?
xAI serves billing data only to management keys, not to the API keys that call models. A management key can also manage your API keys, which is why Burnstack keeps it only in your computer's keychain and uses it only to read usage.
Will the numbers match the xAI console?
They're the same data as the console's Usage Explorer, per UTC day.

Start watching back.

Five minutes to connect your first vendor. Free for Mac, forever, and every byte stays yours.