Connect xAI
xAI is the company behind the Grok family of models, served through the xAI API. The xAI integration imports your team's daily rated cost and usage data into DoiT Cloud Intelligence so you can analyze Grok API spend in Cloud Analytics.
Prerequisites
-
An xAI team with access to the xAI Console.
-
A DoiT account with the Billing Profiles Admin permission.
Required credentials
| Field | Description | Where to find it |
|---|---|---|
| Team ID | Your xAI team identifier (a UUID) | xAI Console > Settings |
| Management API Key | A management key with read access to billing | xAI Console > Settings > Management Keys |
Inference API keys (the keys you use to call Grok models) do not work for this integration — xAI's billing data is only served by its Management API, which rejects inference keys. You must create a dedicated management key.
Create a management key
-
Sign in to the xAI Console and open Settings > Management Keys.
-
Select Create Management Key and give it a descriptive name.
-
Under Access, set Billing to Read only. Leave every other endpoint at No access.
-
Leave the Allowed IP Address list empty. DoiT ingests your data from a pool of egress addresses, so restricting the key to a single IP address causes intermittent connection failures.
-
Select Save and copy the key.
CautionThe key is only shown once. Make sure to copy it before closing the dialog.
Connect your xAI team
-
Sign in to Cloud Intelligence, select Data ingestion and integrations > Integrations from the top navigation mega menu.
-
Search for xAI in the integrations catalog.
-
Select Connect + on the integration card.
-
Enter your Team ID and Management API Key.
-
Select Test connection to verify DoiT can access your xAI team.
-
If the test is successful, select Save to complete the setup.
If the test fails or you need further assistance, please open an expert inquiry.
Upon initial connection, DoiT imports up to 180 days of historical xAI cost data. The import process can take a few hours. You'll receive an email when the data is available in Cloud Analytics.
Data refresh
DoiT refreshes your xAI billing data every six hours at daily granularity.
Reporting dimensions
Once connected, xAI data maps to the following standard Cloud Analytics dimensions:
| Cloud Analytics dimension | xAI value | Example |
|---|---|---|
| Provider | xAI | xAI |
| Billing Account | Team ID | 0000...-0000 |
| Service | Grok API | Grok API |
| SKU | Product-prefixed model | API grok-4.3 |
In addition to standard dimensions, the following xAI-specific labels are available:
| Label | Description |
|---|---|
| Model | The model that generated the charge |
| Usage Type | Billable unit, normalized across AI providers (e.g., input_tokens, reasoning_output_tokens) |
| Cached | Whether the tokens were served from prompt cache |
| Region | The xAI cluster that served the requests (e.g., us-west-2) |
| API Key | The team API key that incurred the charge, by display name |