New
Grok-4.1 · 1M tokens
xAI's flagship. The same base as Grok-4 with all gains coming from post-training: roughly 50% stronger coding and state-of-the-art results on SWE-Bench Pro. Reasoning is always on and can be dialled from low to max.
What you get
- 1M tokens for every unit you buy. Order several units to stack quota.
- A personal access key for
grok-4.1, issued automatically once your order is completed. - No shipping: delivery is digital, under My Account > Order History and by email.
Capabilities
- Flagship
- Reasoning max
- Tool calls
- Structured output
Best for
Repository-scale refactors, long-horizon agents and security review.
Quick start
from xai_sdk import Client
from xai_sdk.chat import user
client = Client(api_key="YOUR_ACCESS_KEY")
chat = client.chat.create(model="grok-4.1")
chat.append(user("Hello"))
print(chat.sample().content)
| Model Specs | |
| Model ID | grok-4.1 |
| Context Window | 1M tokens |
| Max Output | 128K tokens |
| Modalities | Text in / text out |
| Capabilities | Flagship, Reasoning max, Tool calls, Structured output |
| Best For | Repository-scale refactors, long-horizon agents and security review |
| Unit Size | 1M tokens |
$4.40
10 or more $4.18
50 or more $3.96