2026-07-12

How to Use Grok 4.5 for Coding (2026)

Grok 4.5 shipped July 8, 2026 — $2/$6 per MTok, 80 TPS, built for coding and agents. Here's how to use it in Grok Build, Cursor, and the API, plus what the benchmarks and pricing actually mean.

To use Grok 4.5 for coding, pick one of three paths: run it as the default model in Grok Build (curl -fsSL https://x.ai/cli/install.sh | bash), select it in Cursor on any plan, or call model ID grok-4.5 on the SpaceXAI API. It shipped July 8, 2026 at $2 / $6 per million tokens (input / output). Below: what actually shipped, which path to pick, and when Grok 4.5 is the right model versus Claude or GPT.

That’s the short answer. The rest is the honest version — because “use Grok 4.5” is three different products (model, CLI agent, editor integration), and mixing them up is how you waste a weekend.

What shipped

SpaceXAI released Grok 4.5 on July 8, 2026 as its strongest model for coding, agentic tasks, and knowledge work — trained alongside Cursor on real developer session data (SpaceXAI; TechCrunch).

From the official model card and docs (docs.x.ai — grok-4.5; announcement):

  • Model ID: grok-4.5 (aliases: grok-4.5-latest, grok-build-latest)
  • Context: 500,000 tokens; text + image → text; function calling, structured outputs, reasoning
  • Pricing: $2 input / $0.50 cached input / $6 output per million tokens
  • Speed: served at about 80 tokens/sec
  • Availability: Grok Build, Cursor (all plans), SpaceXAI console/API — not yet in the EU at launch (expected mid-July)

Elon Musk framed it as an “Opus-class” model that is faster, more token-efficient, and lower cost (TechCrunch). Treat that as marketing positioning, not a benchmark. The numbers that matter are below.

Benchmarks that matter for coding (with caveats)

SpaceXAI published a multi-benchmark chart on the launch post. Competitor figures are drawn from each lab’s system cards or leaderboards (SpaceXAI):

Benchmark Grok 4.5 Notes on the field
SWE Marathon (pass@1) 29.0% Leads the chart they published (Opus 4.8 max 26.0%, Fable max 24.0%)
Terminal Bench 2.1 83.3% Within a point of Fable max (84.3%) and GPT-5.5 xhigh (83.4%)
SWE-Bench Pro 64.7% Behind Fable max (80.4%) and Opus 4.8 max (69.2%); ahead of GPT-5.5 xhigh (58.6%)
DeepSWE 1.0 62.0% Behind Fable max (66.1%) and GPT-5.5 xhigh (64.3%)
DeepSWE 1.1 53% Behind Fable max (70%) and GPT-5.5 xhigh (67%)

Two more claims from the same post that actually change how you budget a session:

  • Token efficiency: ~15,954 average output tokens per SWE-Bench Pro task vs ~67,020 for Opus 4.8 (max) — about 4.2× fewer tokens on that measurement
  • Office work: default model in Grok Build for Excel / PowerPoint / Word agentic flows, not only pure coding

Honest caveats. These are vendor-chosen benchmarks with vendor-chosen harnesses. SWE-Bench Pro and Terminal-Bench measure different things; a model can win one and lose another. Your repo is the real benchmark. Use the table as a rough ranking and a pricing argument — not gospel. For the full three-way pick guide, see Grok 4.5 vs Claude Fable 5 vs GPT-5.6.

Three ways to use Grok 4.5 today

1. Grok Build (terminal coding agent)

Grok 4.5 is the default model in Grok Build, SpaceXAI’s terminal coding agent (Grok Build launch; Grok 4.5 post). Install:

curl -fsSL https://x.ai/cli/install.sh | bash

Grok Build supports plan mode (approve before execute), clean diffs, AGENTS.md / plugins / hooks / skills / MCP, parallel subagents, worktrees, and headless mode (-p) for scripts. Free Grok 4.5 usage in Grok Build and Cursor is a limited-time promo at launch — check the current offer on x.ai/cli.

How Grok Build compares to Claude Code and Codex as agent products (not just models): Grok Build vs Claude Code vs Codex.

2. Cursor

Grok 4.5 is available in Cursor on all plans as of the launch day (SpaceXAI; Cursor). If your day already lives in Cursor, this is the lowest-friction path: select the model and keep your existing editor workflow.

3. SpaceXAI API

For apps, custom agents, and your own tooling:

curl -s https://api.x.ai/v1/responses \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4.5",
    "input": "Find and fix the bug, then explain it: function median(a){a.sort();return a[a.length/2]}"
  }'

(SpaceXAI announcement; model docs)

Get an API key from the SpaceXAI console. Rate limits at launch include high throughput caps on the model card (e.g. large TPM allowances) — check the live docs for current numbers.

When Grok 4.5 is the right pick (and when it isn’t)

First principles: a coding model earns its seat on correctness per dollar per minute, not on marketing tier names.

Reach for Grok 4.5 when:

  • You want frontier-ish coding at ~$2 / $6 — roughly an order of magnitude cheaper on list rates than Claude Fable 5’s $10 / $50, and cheaper than GPT-5.6 Sol’s $5 / $30
  • Speed and token thrift matter — 80 TPS plus the claimed efficiency edge means long agent loops cost less wall-clock and fewer output tokens
  • You’re already in Grok Build or Cursor and want the default model to be the new flagship

Reach for something else when:

  • Your work is hard, repo-level engineering where SWE-Bench Pro-style difficulty dominates — Fable 5 still leads that chart by a wide margin
  • You need EU availability right now — Grok 4.5 is not yet available in the EU in SpaceXAI products or the API console
  • You need a three-tier cost ladder inside one vendor family — GPT-5.6’s Sol / Terra / Luna is built for that mix-and-match

Most working engineers will not “pick one forever.” They’ll mix: Grok 4.5 for volume and speed, Fable 5 for the gnarly one-pass refactor, GPT-5.6 Terra for everyday Codex runs. Match the model to the task, not to the leaderboard screenshot.

Practical tips for coding with Grok 4.5

  1. Prefer plan-then-execute on large changes. In Grok Build, start in plan mode for multi-file work; approve or edit the plan before the agent writes.
  2. Budget on output tokens. Agents spend most money on what they generate. The efficiency claim matters most on long SWE-style loops — still measure against your own traces.
  3. Cache-stable context. Cached input is $0.50 / MTok vs $2 miss — keep the stable half of the prompt stable when you call the API yourself.
  4. Don’t confuse the three surfaces. Grok Build = terminal agent. Cursor = editor. API = raw model. Same weights family, different product constraints (billing, EU, free promos).
  5. Run one real task before changing defaults. Published charts are a ranking signal; your monorepo, test suite, and review culture decide the rest.

FAQ

When was Grok 4.5 released? July 8, 2026, by SpaceXAI (official post).

How much does Grok 4.5 cost? $2 / $6 per million tokens (input / output), $0.50 for cached input (model docs).

Is Grok 4.5 free? Limited free usage was offered at launch in Grok Build and Cursor; API usage is paid. Check current promos on x.ai/cli.

What is the model ID? grok-4.5 (also grok-4.5-latest, grok-build-latest).

Can I use Grok 4.5 in the EU? Not at launch. SpaceXAI expects EU availability mid-July 2026 (announcement).

Is Grok 4.5 better than Claude or GPT-5.6? It depends on the axis. Grok leads on list price and speed; Fable 5 leads hard SWE-Bench Pro work; GPT-5.6 wins on tiered pricing. Details: Grok 4.5 vs Claude Fable 5 vs GPT-5.6.

Where to start

Sources