8/13/2026↻ Updated 9/22/2026

Grok 4.7: updating long-running agents after Grok 4.6

Realistické noční pracovní místo s obrazovkami zobrazujícími dlouhý agentní workflow

September 22, 2026 update: Grok 4.7 launched on September 21

xAI announced Grok 4.7 on September 21. This extends the existing article because the long-running-agent design remains relevant.

The API ID is grok-4.7. The model documentation lists a 500k context window and standard prices in USD per million tokens:

Input length Input Cached input Output
Up to 200k tokens 2 0.50 6
Above 200k tokens 4 1 12

A migration detail matters: Responses API returns reasoning.encrypted_content even without an explicit request. The Grok 4.7 guide requires preserving it for continuation. Middleware must not strip it while normalising history. Test a complete tool-call cycle, not just the first text response.

At twice the token rates, Fast mode is currently limited to Cursor and Grok Build according to the documentation; it is not available in the public API. The announcement's broader wording should not be read as an API availability promise.

Compare completed tasks on 4.6 and 4.7 with the same tool budget and a stable prompt_cache_key. Track cost per accepted result and the effect of crossing 200k input tokens. Vendor benchmarks justify a trial, not an assumption of savings in your repository or CRM.

Original Grok 4.6 analysis

The following preserves the August context and orchestration principles. Model names and availability below refer to 4.6; use the update above for 4.7.


Grok 4.6 matters for more than another benchmark gain. The useful combination is this: it targets long-running agents, costs $2 per million input tokens and $6 per million output tokens, and its documentation immediately points to two operational details that determine the real bill — a stable cache key and context compaction.

That is more useful to companies than the general claim that this is xAI's smartest and fastest model. Agents are not judged by the first reply. They are judged by whether they can stay with a task across dozens of steps, use tools, recover from failure, and avoid charging you for the same context over and over.

What xAI released

xAI announced Grok 4.6 on August 12, 2026. The API model ID is grok-4.6. It has a 500,000-token context window, accepts text and images, supports both the Responses API and Chat Completions, and can use function calling, web and X search, and code execution. Reasoning can be set to low, medium, high, or xhigh; the default is high.

The standard version costs $2 per million input tokens and $6 per million output tokens. The fast variant is twice the price. Grok 4.6 is available through the xAI API, Grok Build, Cursor, and gateways including OpenRouter, Vercel, and Cloudflare.

xAI positions it for coding, agentic tasks, and knowledge work. Its reported evaluations show a large improvement over Grok 4.5. It is still worth reading the full table rather than the winning bar. In xAI's numbers, Grok 4.6 matches GPT-5.6 Sol on the composite Artificial Analysis Intelligence Index and leads it in some agentic evaluations, but remains behind on DeepSWE and Terminal-Bench. Fable 5 still performs better on part of the suite.

That is not a problem. It is what modern model comparisons look like: no model wins everything, and vendors report results under their own setups. Production decisions need an internal task set, not another leaderboard screenshot.

$2/$6 is the beginning of the calculation

The cost of a one-shot extraction or classification call is easy to estimate. A long-running agent may resend the system prompt, policies, repository context, history, and tool results on every step.

xAI therefore recommends setting prompt_cache_key in the Responses API, or the x-grok-conv-id header with Chat Completions. The goal is to route follow-up requests to the same server so the cache can actually hit. Without a stable key, an agent may pay the full input price even when it keeps sending nearly identical context.

The second requirement is context compaction. A long run should not carry every intermediate result forever. Older history needs to be reduced to decisions, open questions, evidence, and current state. Otherwise cost and latency grow, while important instructions get buried in noise.

For an agent runtime, I would log at least:

  • a stable task ID for caching,
  • tokens and cost by step,
  • context size before and after compaction,
  • tool calls and retry counts,
  • a clear stop condition and maximum budget,
  • resumable state after an interruption.

Only then can you calculate cost per completed task. Token-list pricing alone does not tell you whether an agent is cheap.

Where I would test Grok 4.6

The first candidate is longer work across a repository: investigate an issue, plan a change, edit multiple files, run tests, fix failures, and return a final diff. Test it on work that requires several loops through the codebase, not on generating one function.

The second candidate is a research workflow. A lower-cost step can collect vendor release notes, pricing pages, and documentation changes; Grok 4.6 receives the relevant sources, resolves conflicts, and produces a linked memo. Web search should be a tool, not permission to browse forever. Every search needs a question, a limit, and a rule for when the agent has enough evidence.

The third candidate is visual and interactive delivery. xAI emphasizes stronger first passes on interactive projects and more self-testing. A useful test is a web app that the agent implements, runs, captures through Playwright, and then repairs based on screenshots. Measure the finished app and the number of correction loops, not the beauty of its first response.

The fourth candidate is complex business documentation: a tender, audit pack, contract set, or technical due diligence. A 500,000-token window can hold a large corpus, but I would still avoid dumping everything in without selection. Retrieval or a cheaper filtering pass lowers cost and improves source traceability.

Where a strong model is unnecessary

I would not make Grok 4.6 the default for every invoice, support ticket, CRM enrichment task, or short email draft. Its price is attractive compared with some frontier models, but high reasoning and a long agent loop are wasteful when rules, a small model, or one structured call are enough.

In n8n or Make, a router is usually healthier:

  1. rules and a cheap model handle normalization, spam, tagging, and simple extraction,
  2. a middle-tier model handles everyday ambiguity,
  3. Grok 4.6 receives cases with long context, multiple tools, or expensive failure,
  4. a person approves production changes, financial decisions, or sensitive-data actions.

A sensible pilot does not start by replacing the entire stack. Take 30–50 real completed tasks, run them through the current model and Grok 4.6 with the same tools, and compare success rate, cost, latency, human interventions, and audit-trail quality.

My take

Grok 4.6 is worth testing where an agent works for a long time and failure costs more than a few extra tool calls. Its $2/$6 pricing can be genuinely attractive, but only if the runtime uses caching, compacts history, and stops the loop on time.

The most practical story is therefore not that one model beat another. It is that a long-running agent is an operating system. The model matters, but the outcome is determined by the loop, tools, cache, budget, tests, and human handoff.

Sources: xAI: Introducing Grok 4.6, xAI Docs: Grok 4.6, xAI Docs: Models, xAI Docs: Pricing, and Marek Bartoš: Grok 4.6 — cheaper AI agents change the game.