Speed
Output tokens / second
Custom pricing for production workloads
xAI's large language model for text generation and reasoning, with a 500K token context window and prompt caching support.
x-ai/grok-4-6https://api.aimlapi.com/v1Grok 4.6 is xAI's large language model for text generation and reasoning tasks, with a 500K token context window and prompt caching support.
Grok 4.6 is documented as suited to coding, engineering, and office work tasks, including complex multi-step work across codebases and turning ideas into polished applications or work artifacts.
It is also documented for agentic long-running workflows, especially research across unfamiliar domains, analysis, and iterative development of applications and work artifacts.
The model card says it is evaluated on physical-world engineering workflows such as electrical and chip design, procedural 3D modeling via code, and parametric CAD and part generation.
Its documentation also highlights scientific research as a legitimate use case, alongside engineering and creative work.
See how Grok 4.6 compares in generation speed and latency. Data retrieved Nov 3, 2026.
Output tokens / second
Compare 7 models available on AI/ML API across 5 independent benchmarks.
Expert-written questions across academic subjects.
Graduate-level science questions written to resist web search.
Agentic tasks completed in a command-line environment.
Reasoning across long documents of about 100k tokens.
Python coding tasks drawn from scientific research.
| Usage | Price | Unit |
|---|---|---|
| Input | $2 | 1M tokens |
| Output | $6 | 1M tokens |
| Cached input | $0.5 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| $2 | $6 | |
| $1 | $2 | |
| $1.25 | $2.5 | |
| $2 | $6 | |
| $2 | $6 |
Give your agent the model details, code and documentation.
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"curl 'https://api.aimlapi.com/v1/chat/completions' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "x-ai/grok-4-6",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "x-ai/grok-4-6",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "x-ai/grok-4-6",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Grok 4.6 has a 500,000 tokens context window.
Grok 4.6 takes text, file in as input and returns text out.
Use x-ai/grok-4-6 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.
Grok 4.6 became available on August 7, 2026.
Grok 4.6 costs $2 input and $6 output per 1M tokens on AI/ML API, billed as you go with no subscription.
Yes, Grok 4.6 can stream responses as they are generated.
Grok 4.6 was built by xAI .