How to Switch to Grok 4.6 in the API, Cursor & Grok Build
Read time: ~7 minutes. TL;DR — the swap itself:
client = OpenAI(api_key=os.environ["XAI_API_KEY"], base_url="https://api.x.ai/v1") # model="grok-4.6", and drop presencePenalty / frequencyPenalty / stopKey facts:
- Model ID
grok-4.6, base URLhttps://api.x.ai/v1, 500,000-token context, knowledge cutoff February 1, 2026.- $2.00 in / $6.00 out per 1M — but $4.00 / $12.00 once a request’s prompt reaches 200,000 tokens. Same model ID, two prices.
- Cached input went from $0.30/1M (Grok 4.5) to $0.50/1M — a 67% increase on the discounted rate.
reasoning_effortdefaults tohigh, acceptslow/medium/high/xhigh(4.6 only, silently downgraded tohighelsewhere). Reasoning cannot be disabled.presencePenalty,frequencyPenaltyandstopare incompatible with reasoning models — the most common silent migration failure.- AA Intelligence Index 56 → 61 at the same base price, but Terminal-Bench v3.0 is 26% on xAI’s own card versus 34.6% for GPT-5.6 Sol.
Sourcing note: every model ID, price, parameter and benchmark below is quoted from xAI’s official models reference, reasoning guide, API overview and the Grok 4.6 announcement, re-verified against the live pages on August 13, 2026. Benchmarks are xAI’s own published card and Artificial Analysis’s independent measurements, each attributed inline. Links at the bottom.
Grok 4.6 went live on August 12, 2026. The base price is unchanged from Grok 4.5 — $2.00 / $6.00 per 1M tokens — while the Artificial Analysis Intelligence Index moved from 56 to 61, which puts it level with GPT-5.6 Sol and two points behind Claude Opus 5. (Source: xAI and Artificial Analysis, both 2026-08-12)
That combination — more capability, same sticker — makes this look like a free upgrade. It mostly is. But three things changed underneath the price tag, and all three can surprise you after the swap: a doubling pricing tier above 200,000 prompt tokens, a new xhigh reasoning effort that only exists on 4.6, and a set of sampling parameters that are silently incompatible with reasoning.
This guide covers every surface with exact strings, plus the one benchmark row that argues against switching.
On the commands below: every command, model ID and parameter in this guide is quoted from xAI’s official documentation (
docs.x.ai), verified against the live docs on 2026-08-13. They have not been executed on our own machine, so treat the outputs as documented behaviour rather than a reproduction.
The 30-second answer
- API model ID:
grok-4.6 - Base URL:
https://api.x.ai/v1 - Context window: 500,000 tokens
- Price: $2.00 in / $6.00 out per 1M — but $4.00 / $12.00 once a request’s prompt reaches 200,000 tokens
- Cached input: $0.50/1M below the threshold, $1.00/1M above it
- Knowledge cutoff: February 1, 2026
- Reasoning: always on, cannot be disabled;
reasoning_effortacceptslow,medium,high(default),xhigh - Also available in: Cursor, Grok Build, OpenRouter (
x-ai/grok-4.6), Vercel, Cloudflare
(Source: xAI models reference)
Should you switch at all?
Here is the honest version, using xAI’s own published card rather than the headline.
| Benchmark | Grok 4.6 | Grok 4.5 | GPT-5.6 Sol | Claude Fable 5 |
|---|---|---|---|---|
| AA Intelligence Index | 61 | 56 | 61 | 62 |
| GDPVal-AA v2 (Elo) | 1753 | 1526 | 1728 | 1741 |
| CursorBench v3.2 | 69.9% | 66.7% | 67.2% | 70.5% |
| DeepSWE v1.1 | 65.9% | 54% | 73% | 70% |
| FrontierCode v1.1 (Extended) | 61.3% | 56.6% | 60.6% | 63.6% |
| APEX-Agents | 57.5% | 47.1% | 56.7% | 59.2% |
| Terminal-Bench v3.0 | 26% | 15.7% | 34.6% | 34.1% |
| APEX-SWE | 56.4% | 53.6% | — | 58.8% |
| AA-Briefcase (Elo) | 1577 | 1313 | 1502 | 1574 |
| Harvey LAB (Vals) | 15.8% | 12.9% | 2.5% | 11.3% |
(All figures from xAI’s Grok 4.6 announcement. xAI’s own footnote states third-party scores are the best of self-reported or publicly available results.)
Read that table by column, not by row. Against Grok 4.5, 4.6 wins every single line — often by a lot (DeepSWE +11.9 points, Terminal-Bench +10.3, AA-Briefcase +264 Elo). If you are on 4.5 today, this is an unambiguous upgrade at the same base price.
Against the frontier it is a split decision. Grok 4.6 leads on GDPVal-AA v2, AA-Briefcase and Harvey LAB — all knowledge-work and analysis benchmarks. It trails Fable 5 on most coding rows and it is last by a wide margin on Terminal-Bench v3.0 (26% versus 34.6% and 34.1%).
The decision rule: switching from Grok 4.5 is a yes. Switching to Grok from Claude or GPT depends on whether your workload looks more like report generation (Grok is competitive and much cheaper) or more like driving a terminal (it is not).
xAI’s own Intelligence Index chart from the Grok 4.6 announcement. Source: x.ai
The cost story, which is the actual reason to consider it
Artificial Analysis measures $0.84 as the weighted average cost per Intelligence Index task for Grok 4.6. Claude Opus 5, which scores two points higher at 63, costs roughly $2.40 per task on the same chart; Claude Fable 5 at 62 costs about $3.
There is a second, less obvious driver. AA reports Grok 4.6 completing its agentic evaluations in roughly 53 turns and 0.5B input tokens on average, against roughly 103 turns and 2.0B input tokens for Claude Opus 5. (Source: Artificial Analysis, 2026-08-12)
Cost per Intelligence Index task vs index score. Source: Artificial Analysis
That gap matters more than the per-token price. Every extra turn in an agent loop re-sends the system prompt, the tool schema and the accumulated transcript. A model that needs half the turns pays that tax half as often — and, critically, is far less likely to push a request across the 200K threshold where the rate doubles.
The 200K pricing cliff
This is the single most important operational fact about Grok 4.6, and it is easy to miss because both tiers use the same model ID.
| Prompt size | Input | Cached input | Output |
|---|---|---|---|
| Under 200,000 tokens | $2.00 / 1M | $0.50 / 1M | $6.00 / 1M |
| 200,000 tokens and above | $4.00 / 1M | $1.00 / 1M | $12.00 / 1M |
(Source: docs.x.ai models reference. OpenRouter documents the same split on x-ai/grok-4.6, with the threshold expressed as min_prompt_tokens: 200000.)
Three consequences worth planning around:
- The 500K context is a two-price context. You can use all of it, but the last 300K costs double. Budgeting a long-context workload at $2/$6 will under-forecast by up to 2×.
- Long agent runs drift across the line. A conversation that starts at 40K tokens and accumulates tool output can cross 200K mid-session, and the rate change applies from that request onward. If your cost dashboard aggregates by model ID, you will see the blended rate move without any config change.
- The cached-read discount changed shape. Grok 4.5 charged $0.30/1M for cached input below the threshold; 4.6 charges $0.50/1M. Cache reads are still a 4× discount off fresh input, but the absolute number went up 67%. Prompt-caching-heavy workloads should re-run their own math rather than assuming 4.5’s economics carried over.
Practical mitigation: truncate or summarise transcript history to keep steady-state requests under 200K, and log prompt token counts per request so you can see how often you cross. Do this before the swap, not after the first invoice.
The API: exact request shape
The base URL is https://api.x.ai/v1 and the documented minimal call uses the Responses endpoint:
curl https://api.x.ai/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-d '{"model":"grok-4.6","input":"Fix this function..."}'
(Quoted from docs.x.ai overview.)
xAI’s documentation uses the OpenAI Python client pattern (from openai import OpenAI), so pointing an existing OpenAI-SDK integration at Grok is a base-URL and model-ID change rather than a rewrite:
from openai import OpenAI
client = OpenAI(
api_key=os.environ["XAI_API_KEY"],
base_url="https://api.x.ai/v1",
)
If you already keep base_url and model ID behind config — the pattern we recommended for Qwen3.8-Max and for every Claude version bump — this is a one-line environment change.
Reasoning effort: the new xhigh
reasoning_effort takes four values on Grok 4.6:
| Value | xAI’s stated use case |
|---|---|
low | Latency-sensitive agentic tasks |
medium | Complex data analysis |
high | Challenging problems — this is the default |
xhigh | Grok 4.6 only |
(Source: docs.x.ai reasoning guide)
Two details that bite during a migration:
xhigh degrades silently. On models that do not support it, xhigh is treated as high. That is convenient for portable code and dangerous for A/B tests: if you send xhigh to a router that falls back to Grok 4.5, you get high behaviour and no error to tell you the comparison was invalid.
The default is high, not low. If you do not set reasoning_effort, every request reasons at the second-highest setting. Reasoning tokens are billed as output tokens, so an unset parameter is a real line item. For agent loops where latency matters more than depth, low is the setting you want and you must ask for it explicitly.
Reasoning cannot be turned off
There is no non-reasoning mode on Grok 4.6 or 4.5. If you need a cheap, fast, non-reasoning model in the same family, grok-4.3 is the documented alternative — it also carries a 1M context and lower rates ($1.25/$2.50 below the threshold).
Three parameters that stop working
The reasoning guide lists presencePenalty, frequencyPenalty and stop as incompatible with reasoning models. If your current integration sets any of them — and a lot of older OpenAI-era code sets stop by default — clear them before pointing at grok-4.6. This is the most common silent migration failure: the parameter is meaningful on your previous model and inert or rejected here.
Getting the reasoning content back
Three documented paths:
- Reasoning token counts come back in the usage metrics — enough for cost attribution.
- Encrypted reasoning content is returned when you pass
include: ["reasoning.encrypted_content"]. This is what you want for multi-turn workflows that need to preserve the model’s chain across requests without exposing it. - Reasoning summaries stream as deltas, and the docs call this out specifically for
grok-4.6. If you are building a UI that shows “thinking” progress, this is the hook.
Cursor
Grok 4.6 is available in Cursor from day one, per xAI’s launch post. In practice a new model shows up in Cursor’s model selector server-side, so there is usually nothing to install — open the model picker and select it.
xAI publishes a CursorBench v3.2 score of 69.9% for 4.6 against 66.7% for 4.5, so this is the surface where the upgrade was explicitly tuned. Fable 5 still edges it at 70.5%.
Grok Build
Grok Build was listed as available on day one as well. If you already run the CLI, our Grok Build guide and the CLI install walkthrough cover setup and auth; the model change itself is a selector or config change, not a reinstall.
Note that grok-build-0.1 is a separate, cheaper model in the models reference (256K context, $1.00–$2.00 in / $2.00–$4.00 out) — it is not an alias for Grok 4.6. Check which one your CLI session is actually using before attributing a quality change to the upgrade.
OpenRouter, Vercel and Cloudflare
All three were listed as launch partners. On OpenRouter the model ID is x-ai/grok-4.6, with a 500,000-token context and the same two-tier pricing (the long-context override kicks in at 200,000 prompt tokens with $4.00 / $12.00 and $1.00 cache reads).
Routing through an aggregator adds one migration risk worth naming: fallback chains. If your router is configured to fall back to Grok 4.5 on error, and you are sending xhigh, the fallback quietly runs at high. Pin the fallback explicitly or make failures visible.
Migrating from Grok 4.5: the checklist
- Change the model ID to
grok-4.6(x-ai/grok-4.6on OpenRouter). - Remove
presencePenalty,frequencyPenaltyandstopif present. - Set
reasoning_effortexplicitly. The default ishigh; picklowfor latency-bound agent loops. - Re-check your cache math. Cached input went from $0.30/1M to $0.50/1M below the threshold.
- Instrument prompt token counts so you can see how often requests cross 200,000 and land in the $4/$12 tier.
- Re-run your own eval set. Compare cost per completed task, not cost per token — the turn-count difference is where the savings actually appear.
- If your agent lives in a terminal, test that path specifically. Terminal-Bench v3.0 at 26% is the weakest published row on xAI’s own card.
When not to switch
- Terminal-heavy agents. 26% on Terminal-Bench v3.0 against 34.6% for GPT-5.6 Sol. Be careful reading benchmark citations here: Artificial Analysis reports 88.4% on Terminal-Bench v2.1, an older and much easier version. Anyone quoting ~88% and anyone quoting 26% are both right about different benchmarks. Test on your own harness.
- Workloads that need more than 500K context.
grok-4.3carries 1M tokens; Grok 4.6 does not. - Anything requiring a non-reasoning mode. It does not exist on 4.6.
- Knowledge past February 1, 2026. That is the documented cutoff; anything newer needs retrieval or web search.
Bottom line
If you are running Grok 4.5, switch — every published benchmark improved and the base price did not move. If you are evaluating Grok against Claude or GPT, the case is cost-shaped rather than capability-shaped: index 61 at roughly $0.84 per task, in about half the turns of Opus 5, is a strong ratio for high-volume knowledge work and a weak one for terminal-driving agents.
Whichever way you go, set reasoning_effort explicitly and watch the 200K line. Those are the two settings that decide what this model actually costs you.
Sources
- xAI — Grok 4.6 announcement (2026-08-12)
- xAI docs — Models reference
- xAI docs — Reasoning guide
- xAI docs — Overview / API base URL
- Artificial Analysis — Grok 4.6 benchmarks and analysis (2026-08-12)
- OpenRouter — x-ai/grok-4.6
Related: Grok 4.6 release news · How to use Grok Build · Grok Build CLI install guide · How to switch to Claude Opus 5