StackSpendDocs

Grok (xAI)

Connect your xAI account to track Grok API costs and model-level token usage in StackSpend.

Grok (xAI) logo

Grok (xAI)

xAI Management API — real-time billing data

The Grok provider connects StackSpend to your xAI account via the xAI Management API. Once connected, StackSpend loads your full billing history on the first sync and then tracks new usage in real time.

What StackSpend tracks

  • API costs broken down by model (Grok-2, Grok-1.5, and others)
  • Input and output token usage per model
  • Full historical data loaded on first connection

Prerequisites

  • An xAI account with Grok API access

Setup

1

Get your Management API key

Go to console.x.ai and navigate to API Keys → Create key. Give it a name such as “StackSpend”. Copy the key after creation.

2

Add to StackSpend

In StackSpend, go to Providers → Grok (xAI). Paste your API key into the key field and click Save.

3

Verify

Data appears within minutes of saving. Your full billing history is loaded on the first sync.

Data summary

AttributeValue
Data latencyReal-time
Historical dataFull history
Setup time2 min
StackSpend Docs