xAI: Grok 4✓ Catalog verified
Grok 4 is xAI's latest reasoning model with a 256k context window. It supports parallel tool calling, structured outputs, and both image and text inputs. Note that reasoning is not exposed, reasoning cannot be disabled, and the reasoning effort cannot be specified. Pricing increases once the total tokens in a given request is greater than 128k tokens. See more details on the xAI docs
Overview
Grok 4 is xAI's latest reasoning model with a 256k context window. It supports parallel tool calling, structured outputs, and both image and text inputs. Note that reasoning is not exposed, reasoning cannot be disabled, and the reasoning effort cannot be specified. Pricing increases once the total tokens in a given request is greater than 128k tokens. See more details on the xAI docs
Access: available through the official X Ai API. Context window: 256K.
Specifications
| API identifier | x-ai/grok-4 |
| Provider | X Ai |
| Model type | Multimodal LLM |
| Context window | 256K catalog |
| Input modalities | image · text |
| Output modalities | text |
| Released | Jul 9, 2025 |
| Tokenizer | Grok |
| Moderated | No |
| Architecture modality | text+image->text |
Pricing
Live pricing components for x-ai/grok-4 as published in the catalog.
| Pricing component | Raw unit price | Normalized | Unit |
|---|---|---|---|
| Prompt tokens | $0.000003 | $3.00 / 1M | Per input token |
| Completion tokens | $0.000015 | $15.00 / 1M | Per output token |
| Request fee | N/A | N/A | Per request |
| Image fee | N/A | N/A | Per image unit |
| Web search fee | $0.005 | $0.005000 | Per search request |
Cost calculator
Estimate monthly spend from your own token volumes.
Estimated Total Cost
$4.5Calculated from current list pricing in the ModelsAtlas catalog.Capabilities
| Capability | Status | What it means |
|---|---|---|
| Visual Understanding | ✓ Supported | Image and document analysis support |
| Audio Processing | Not advertised | Speech and voice aligned flows |
| Tool Calling | ✓ Supported | Supports tools / function calling |
| Self-Hosting | Not advertised | Deploy outside managed APIs |
Capability signals
Directional signals derived from model metadata and capability tags — not official benchmark submissions.
Quick start
Call xAI: Grok 4 through an OpenAI-compatible client.
from openai import OpenAI
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
model="x-ai/grok-4",
messages=[{"role": "user", "content": "Explain quantum physics."}]
)
print(response.choices[0].message.content)Alternatives
Closest models by context window from a different provider.
| Model | Provider | Context | Input /1M | Actions |
|---|---|---|---|---|
| AI21: Jamba Large 1.7 | AI21 | 256K | $2.00 | View → |
| Cohere: Command A | Cohere | 256K | $2.50 | View → |
Sources & attribution
Pricing and metadata are maintained in the ModelsAtlas catalog.
Frequently asked questions
How much does xAI: Grok 4 cost?
$3.00 per 1M input tokens and $15.00 per 1M output tokens on the official X Ai API.
What is the context window of xAI: Grok 4?
xAI: Grok 4 supports up to 256K tokens of context.
Does xAI: Grok 4 support tool / function calling?
Yes, xAI: Grok 4 supports tool / function calling — you can register tools and the model will emit structured tool calls.
How do I access xAI: Grok 4?
Use the official X Ai API with the model id `x-ai/grok-4`. See the Quick start section above for code examples.