Grok is xAI's frontier LLM family, exposed through an OpenAI-compatible API with a very large context window and live access to X data. Its headline is cost: the Grok 4.1 Fast tier is one of the cheapest frontier-class models on the market. Here's the pricing, the free credits, and how to get a key.
| Model | Input / 1M | Output / 1M |
|---|---|---|
| Grok 4.1 Fast cheapest | ~$0.20 | ~$0.50 |
| Grok 4 (flagship) | ~$3.00 | ~$15.00 |
| Grok 3 mini | ~$0.30 | ~$0.50 |
| Live Search (X data) | add-on, billed per source/request | |
xAI has typically offered promotional API credits rather than a permanent free tier โ often in exchange for opting into data sharing โ so the exact deal moves around. Grok chat is also included with X Premium, but that's separate from API access, which draws down a billed balance in your console. If you only need to experiment, claim whatever credit promotion is live; for production, budget per-token from the table above and price it with the calculators below.
1. Go to console.x.ai and sign in with your X account.
2. Add a payment method or claim available free credits.
3. Open API Keys and create a new key โ copy it once (it won't be shown again).
4. Because the API is OpenAI-compatible, just change the base URL.
Call it with the OpenAI SDK shape:
Grok 4.1 Fast at roughly $0.20 / $0.50 per million tokens undercuts most frontier options โ cheaper on output than GPT-class mid models and far below Claude Opus. The flagship Grok 4 sits in the same band as GPT-5-class models (~$3 / $15). If cost is the priority, Grok Fast competes with Gemini Flash and DeepSeek; if you need its X-data and reasoning, the flagship is mid-pack. See the OpenAI, Claude, Gemini and DeepSeek guides, then rank them for your exact token mix with the cheapest LLM API tool.
Per million tokens: roughly $3 / $15 for Grok 4, and ~$0.20 / $0.50 for the cheaper Grok 4.1 Fast (reference, July 2026). Confirm in the xAI console.
Yes โ it follows the OpenAI chat-completions shape, so you can reuse the OpenAI SDK and just point the base URL at api.x.ai/v1 and swap the model name.
Usually promotional credits rather than a permanent free tier (sometimes tied to data sharing). X Premium includes Grok chat but not API access. Check the console for the current offer.
A very large context window, strong reasoning modes, and optional Live Search over X (Twitter) data โ useful for real-time and social-aware applications.
Not affiliated with xAI. Prices are reference estimates โ always verify on the official pricing page.