xAI (Grok)
xAI provides the Grok family of models, designed for conversational AI with strong reasoning capabilities, large context windows (up to 2M tokens), and image generation.
Getting an API Key
- Visit console.x.ai
- Sign in or create an account
- Generate a new API key (starts with
xai-...) - Paste the key into AI Supreme Council under Settings > AI Model > xAI
API keys are stored locally in your browser (localStorage) and are never included in shared bot URLs.
Supported Models
| Model | Context Window | Max Output | Input Price | Output Price | Capabilities |
|---|---|---|---|---|---|
| Grok 4.1 Fast | 2M | 16K | $0.20/MTok | $0.50/MTok | Vision, tools, reasoning, code |
| Grok 4 Fast | 2M | 16K | $0.20/MTok | $0.50/MTok | Tools, reasoning, code |
| Grok 4 | 256K | 16K | $3.00/MTok | $15.00/MTok | Tools, reasoning, code |
| Grok 3 | 131K | 131K | $3.00/MTok | $15.00/MTok | Tools, code |
| Grok 3 Mini | 131K | 131K | $0.30/MTok | $0.50/MTok | Tools, reasoning, code |
| Grok Code Fast | 256K | 16K | $0.20/MTok | $1.50/MTok | Tools, code |
Prices are per million tokens (MTok). Cached input pricing available on select models.
- Grok 4.1 Fast is the latest and recommended default -- it combines vision, reasoning, and a massive 2M context window at a low price.
- Grok 4 is the full-power reasoning model for complex tasks.
- Grok 3 Mini is the budget-friendly option with reasoning support and high output capacity (131K tokens).
- Grok Code Fast is optimized specifically for code generation tasks.
Reasoning Support
Grok 3 Mini, Grok 4, Grok 4 Fast, and Grok 4.1 Fast all support reasoning. Since xAI uses the OpenAI-compatible API format, reasoning is controlled via the Reasoning Effort setting:
| Setting | Behavior |
|---|---|
low | Minimal reasoning -- fastest responses |
medium | Balanced reasoning |
high | Deep reasoning -- best quality |
Reasoning output from Grok models appears as reasoning_content in the SSE stream and is displayed in a collapsible thinking block.
Vision Support
Grok 4.1 Fast supports vision input. You can paste, upload, or drag and drop images into the chat, and the model will analyze visual content.
Tool Calling
All Grok models support function/tool calling via the OpenAI-compatible format. Define tools in your bot configuration, and Grok will invoke them as structured function calls.
Image Generation (Grok Imagine)
xAI supports image generation via Grok Imagine. When the Image Generation capability is enabled in AI Supreme Council, image generation requests are automatically routed to xAI alongside other supported providers (OpenAI DALL-E, OpenRouter).
Pricing
xAI bills per input and output token. The Fast models (Grok 4 Fast, Grok 4.1 Fast, Grok Code Fast) are notably affordable at $0.20/MTok input. Refer to x.ai for current pricing.
AI Supreme Council tracks token usage per provider in Settings > Usage.
Configuration
When creating a bot profile, select xAI as the provider and choose your preferred model. You can set a per-bot API key in the bot configuration panel to override the global key.
The xAI provider uses an OpenAI-compatible Chat Completions API (api.x.ai/v1/chat/completions) with Bearer authentication. Models prefixed with grok-* are automatically routed to xAI.
Tips for Best Results
- Leverage the 2M context window. Grok 4 Fast and 4.1 Fast have one of the largest context windows available -- great for analyzing entire repositories or large document collections.
- Use Grok Code Fast for programming. It is specifically optimized for code generation and understanding.
- Start with Grok 3 Mini for experimentation. At $0.30/$0.50 per MTok with reasoning support, it is one of the most cost-effective reasoning models available.