xAI
The pay-per-token API for xAI's Grok models, with a monthly credit program tied to opting in to data sharing.
What it actually does
xAI sells API access to the Grok model line, from the cheap grok-build-0.1 at $1/$2 per 1M tokens up to the Grok 4.5 flagship at $2/$6, released July 2026. There is no standing free tier; new accounts get one-time trial credits.
Its distinguishing offer is a data-sharing program: teams that opt in after spending $5 can earn up to $150/mo in API credits, enough to run a small production feature for free, in exchange for sending prompt data to xAI. Grok 4.5 undercuts most frontier flagships and cached input drops to $0.30 (85% off).
Long-context billing is punitive: prompts at or above 200K tokens reprice the whole request at the higher rate, $4/$12 on Grok 4.5. The data-sharing credits are limited to eligible countries and require $5 of prior spend.
xAI vs its main rivals
The tools people actually weigh against xAI: OpenAI, Anthropic Claude, Google Gemini. Same criteria for every column, including where xAI loses.
Pricing & access | ||||
| Free tier | NoTrial + credit program | NoNo | NoOne-time credits | YesOngoing free tier |
| Starting price | $1 /1M in | $0.20 /1M in | $1 /1M in | $0.10 /1M in |
Models & capability | ||||
| Flagship model price | $2/$6 | up to $30/$180 | $10/$50 | $4 in (Pro) |
| Coding & agent benchmark rank | Competitive | Strong | Leads | Strong |
| Multimodal (image) | YesImage | YesYes | YesImage | YesYes |
Scaling & limits | ||||
| Max context window | 256K | 400K | 200K-1M | 1M |
| No long-context reprice penalty | NoReprices at 200K | YesFlat | YesTiered | NoLong-prompt tier |
| Cached input discount | Yes$0.30 (85% off) | Yes10% rate | Yes10% rate | YesPaid only |
Developer & API | ||||
| REST API access | Paid | Paid | Paid | Free |
| OpenAI-compatible endpoint | YesYes | YesNative | NoOwn API | YesCompat mode |
Data & compliance | ||||
| No training on API data by default | NoOpt-in for credits | YesYes | YesYes | NoFree tier trains |
- Grok 4.5 at $2/$6 per 1M tokens undercuts most frontier flagships, with cached input at $0.30 (85% off)
- grok-build-0.1 at $1/$2 is a cheap entry point for high-volume tasks
- Data-sharing program pays up to $150/mo in credits, enough to run a small production feature free
- Long-context billing is punitive: prompts at or above 200K tokens reprice the whole request to $4/$12
- No standing free tier, and the recurring credits require opting in to data sharing
- Data-sharing credits are limited to eligible countries and need $5 of prior spend
Pay less for it
5 ways foundUp to $150/mo in API credits after $5 prior spend if you accept prompt data sharing
Cached tokens billed at $0.30 per 1M, an 85% discount on repeated prompts
Use the $1/$2 tier for simple, high-volume tasks
Keep prompts below the long-context threshold to avoid repricing the whole request
DeepSeek — Comparable near-frontier reasoning at roughly a third to a tenth of Grok's per-token cost, without the long-context repricing
StackTracker tracks what you actually pay for xAI and every other tool, flags overpayment, and shows the dollars you would save by switching.
Is it the right tool for you
- You want frontier-class output below Claude and OpenAI flagship prices
- You are fine trading prompt data for up to $150/mo in credits
- Your prompts stay comfortably under the 200K long-context threshold
- You need long-context prompts without a full-request repricing penalty → use Anthropic Claude or Google Gemini
- You cannot share prompt data and want a free tier → use Google Gemini
Track what xAI and the rest of your stack cost
StackTracker adds up every subscription, plus your hours, so you see the real number.
Prices and limits last verified 2026-07-20.