Appearance
Connecting xAI (Grok)
What you need
Two things from your xAI account: a Management key, and your Team ID. xAI's usage report is scoped to a team, not just to whichever key is calling it, so TokenFront can't look anything up without both.
Step 1: Create a Management key at xAI
- Go to the xAI Console.
- Make sure your account has Management Keys read permission — ask your team admin if you're not sure.
- Open Settings and create a management key. Give it a name you'll recognize later — "TokenFront" works.
- Copy it — it's a different kind of key than a regular xAI API key, and standard API keys can't read usage data.
- Find your Team ID at console.x.ai → team → Settings → Team.
Step 2: Add both to TokenFront
- Open Connect xAI in TokenFront.
- Paste the key into the Management key field, and your Team ID into the Team ID field.
- Save.
Both fields are required — xAI's usage API is scoped to a specific team, so TokenFront can't sync without the Team ID even with a valid key.
What's different about this connection
xAI's usage report gives TokenFront spend per model, but not per API key — every xAI connection shows one account-wide total rather than a breakdown by key, the same limitation Vercel AI Gateway has. Token counts (prompt/completion) aren't available from this endpoint either, only dollar cost.
If the connection shows "Key rejected"
Double-check both the key and the Team ID under Edit — a valid key paired with the wrong Team ID fails the same way an invalid key does. Also confirm you copied a Management key, not a regular API key.
More about xAI in TokenFront
What TokenFront shows for xAI, and how it fits with your other providers: xAI on tokenfront.io.