Stack SpendDocs

Grok (xAI)

Connect an xAI team to monitor daily Grok API billed USD in StackSpend. Check Management API requirements and billing coverage before your first review.

Grok (xAI) logo

xAI Management API — daily team API spending

Use this connection when your business pays for Grok API usage through an xAI team. It reads daily billed USD and can show available model labels beside your other connected AI providers.

Before you connect

  • An xAI team with API billing you are authorised to access.
  • A Management API key with team billing read access, separate from an inference key.
  • The actual Team ID copied from team settings.
Check coverage before relying on the total.The current connector supplies billed USD, not input/output token counts or user-level usage. Personal Grok and X Premium subscriptions are not covered. Use application logs for request, feature and customer attribution.

Setup and first review

1

Create a Management API key

Select the correct team in the xAI Console and open Management Keys. Create a Management API key with access to read team billing. An inference API key is not sufficient.

2

Copy the Team ID and connect

Copy the actual Team ID from team settings. In StackSpend, open Providers → Grok (xAI), enter the Management API key and Team ID, test the connection and save.

3

Verify the first successful sync

Check the connected team, last successful sync and available dates. Compare billed USD for the same UTC date range with the xAI console. History and freshness depend on xAI reporting and successful syncs.

Open the xAI Management Keys page and select the correct team. Copy its ID from team settings.

What should a useful trial prove?

Verify one complete date range against xAI, explain a change using daily spend and available model labels, and give the next review a named owner. Check plans and feature availability before configuring budgets or notifications. Alerts notify an owner; they do not enforce xAI spending limits.

Review Grok monitoring and trial requirements.

Frequently asked questions

What credentials does StackSpend need?

An xAI Management API key with billing read access and the actual Team ID from team settings. A model inference key is a different credential. Do not use the word default from a console URL as your Team ID.

What does the current Grok connection measure?

Daily billed USD from the xAI billing usage endpoint, grouped by billing description. StackSpend derives model labels from those descriptions when available. It does not supply input/output token counts, request traces or individual user attribution.

Does StackSpend change my xAI account?

StackSpend reads billing information and does not run inference or modify xAI settings. Management keys can carry broader permissions, so use the minimum access required and protect the credential.

How much history loads and is the data real time?

Available history depends on the billing records returned by xAI. Check the available date range and last successful sync; complete invoice history and real-time reporting are not guaranteed.

Why is no cost data showing?

Check that the Management API key is valid, the Team ID is correct and the connection has a successful sync. Confirm that xAI reports billed API usage for the period you selected. An account with no billed usage may have no cost rows.

Can I monitor a personal Grok subscription?

This connector is for xAI team API billing. Personal Grok and X Premium subscriptions, remaining subscription allowances and reset times are not covered.

Source: xAI billing API reference. Coverage above describes the current StackSpend connector, rather than every field the xAI API may expose.

Connect Grok (xAI) to StackSpend — StackSpend Docs