xAI API
Get a xAI API key and call every xAI model (Grok) through Token Harbor with a single key — pay-as-you-go, no separate xAI account or console. Fully OpenAI- and Anthropic-compatible, with transparent per-token pricing and smart routing. See xAI API pricing per model below.
Call it with one key
curl https://tokenharbor.ai/v1/chat/completions \
-H "Authorization: Bearer $TOKENHARBOR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"x-ai/grok-4-fast","messages":[{"role":"user","content":"Hello"}]}'Get a free key at /dashboard/api-keys · point any tool at us with the Connect CLI or manual setup.
xAI models (4)
| Model | Context | $/1M in · out |
|---|---|---|
Grok 4 Fastx-ai/grok-4-fast | 2M | $0.20 · $0.50 |
Grok 4.3x-ai/grok-4.3 | 1M | $1.25 · $2.50 |
Grok 4.5x-ai/grok-4.5 | 500k | $2.00 · $6.00 |
Grok 4x-ai/grok-4 | 256k | $3.00 · $15.00 |
See the full model catalog or read the API docs.