Home / Use cases / xai-grok-billing

Bill per Grok inference call (xAI)

The problem

Grok API is new. There is no native per-tenant billing primitive.

What Spawnpay does

BYOK Grok through Spawnpay proxy. $0.001 per upstream 2xx. Add the paywall SDK on the agent side for per-user caps.

Code

curl -X POST https://spawnpay.ai/api/proxy\
  -H 'Authorization: Bearer spk_live_...'\
  -H 'Content-Type: application/json'\
  -H 'X-Provider-Key: $XAI_API_KEY' \
  -d '{  "provider": "xai",  "path": "/v1/chat/completions",  "method": "POST",  "body": {    "model": "grok-beta",    "messages": [      {        "role": "user",        "content": "hi"      }    ]  }}'
60-SEC QUICKSTART → PLAYGROUND → TOP UP USDC →

What you get with $7 free credit

Every new spk_ wallet starts with $7. That covers 7,000 proxy calls, 1,400 cloud-scrapes, or 700 screenshots — enough to verify Spawnpay fits your workflow before topping up.

See also