AI & DevelopmentDeveloper Tools

Grok 4.5: Cursor-Trained Model at $2 Per Million Tokens

Abstract neural network visualization representing Grok 4.5 agentic AI model with blue and white ByteIota brand colors
Grok 4.5 by xAI — trained on Cursor developer session data

xAI released Grok 4.5 on July 8, and the story isn’t “another frontier model.” It’s that xAI trained on trillions of Cursor session tokens — the actual back-and-forth of developers using AI agents inside codebases — not just code repositories. The result tops independent agentic tool-use benchmarks, resolves SWE-bench tasks using 4.2× fewer output tokens than Claude Opus 4.8, and prices at $2 per million input tokens. For teams running high-volume coding agents, that combination changes the math significantly.

What Makes It Different: Cursor Session Training

Most coding models learn from GitHub repositories. Grok 4.5 learned from how developers actually use AI agents — the tool invocations, the error-recovery loops, the multi-file edits in sequence. xAI partnered with Cursor (now a SpaceX subsidiary) to train on “trillions of tokens of Cursor data that capture real developer-agent interactions.”

That distinction matters in practice. Models trained on static code know what correct code looks like. Grok 4.5 also knows how agents navigate toward it — which explains its #1 rank on TAU-bench agentic tool use (71%) and strong performance on Terminal-Bench 2.1 (83.3%). It’s not just generating code; it’s been trained on the process of getting there.

Benchmark Position: Honest Read

Grok 4.5 lands at #4 on the Artificial Analysis Intelligence Index with a score of 54, up from 38 in Grok 4.3. That’s a meaningful jump, but it’s not Fable 5 or Claude Opus 4.8 on every dimension.

Where it leads: SWE Marathon (29%, beating Opus 4.8’s 26%), agentic tool use (#1), and Terminal-Bench 2.1. Where it doesn’t: SWE-Bench Pro (64.7% vs. Fable 5’s 80.4%) and DeepSWE 1.1 (53% vs. Fable 5’s 70%). If your workload involves complex multi-file refactors evaluated under strict SWE-Bench Pro conditions, Fable 5 still has a significant lead.

One number that deserves attention: the hallucination rate on the AA-Omniscience Index jumped from 25% (Grok 4.3) to 54% (Grok 4.5), even as raw accuracy improved from 35% to 52%. The model got more capable but also more confident when it’s wrong. That’s not a dealbreaker for pure coding work — where you can verify output — but it rules Grok 4.5 out for customer-facing factual queries, legal summarization, or any domain where wrong-but-confident is dangerous.

The Price Math

The list-price comparison — $2/M input versus ~$15/M for Claude Opus 4.8 — already makes Grok 4.5 look compelling. But the more important number is per-task cost, and here the gap widens further.

On SWE-bench Pro tasks, Grok 4.5 uses approximately 15,954 output tokens. Claude Opus 4.8 uses approximately 67,020. At Grok’s $6/M output rate, that’s roughly $0.10 per task. At Opus 4.8’s ~$30/M output rate on 67K tokens, that’s around $2.01 per task — about 20× more expensive. The token efficiency isn’t marketing; it’s a structural feature of how Grok 4.5 approaches long agentic sessions.

At scale — say, 10,000 agent tasks per month — the difference is roughly $1,000 versus $20,000. That’s a meaningful budget line for any engineering team.

API: Drop-In OpenAI Replacement

Grok 4.5 supports both the Responses API and Chat Completions format. Migration from an OpenAI-based stack requires only a URL change and a new API key:

import os
import httpx
from openai import OpenAI

client = OpenAI(
    base_url="https://api.x.ai/v1",
    api_key=os.getenv("XAI_API_KEY"),
    timeout=httpx.Timeout(3600.0),  # allow time for long agentic runs
)

response = client.responses.create(
    model="grok-4.5",
    reasoning={"effort": "medium"},  # "high" is default; use medium for routine tasks
    input=[
        {"role": "system", "content": "You are a senior software engineer."},
        {"role": "user", "content": "Refactor this module for testability: ..."},
    ]
)
print(response.output_text)

The reasoning.effort parameter is the primary cost lever. Set it to high (default) for complex planning tasks. For routine coding operations — bug fixes, refactors with clear specs — medium cuts reasoning token spend without meaningfully degrading output quality. Reasoning tokens are billed as output tokens, so this matters at volume. Full parameter reference is in the xAI reasoning docs.

Available tools include function calling, web and X search ($5 per 1,000 calls), code execution, document search, and context compaction — which summarizes earlier conversation history to sustain the 500K context window across longer sessions without re-sending the full dialogue.

When to Use It (and When Not To)

Use CaseVerdict
High-volume coding agent pipelinesYes — ~20× cheaper per task
Agentic tool use workflowsYes — #1 benchmark, Cursor-trained
Bug fixing and refactoringYes — strong real-world performance
Complex multi-step planning (SWE-Pro class)Test first — Fable 5 leads significantly
Structured JSON output (nested schemas)No — Claude is more reliable
Customer-facing factual queriesNo — 54% hallucination rate
Safety-critical domains (medical, financial, legal)No — use Claude or Fable 5

One practical note: Grok 4.5 is not available in the EU as of July 2026, pending EU AI Act compliance. EU-based teams should check the official xAI announcement for availability updates before building pipelines around it.

Verdict

Grok 4.5 makes the strongest case yet for a two-model strategy: Grok for high-volume coding and agentic tasks where output is verifiable, Claude or Fable 5 for complex reasoning chains and anything customer-facing. The Cursor session training gives it better agentic patterns than the benchmark numbers alone suggest — that #1 agentic tool use rank is not a fluke.

At $2/M input and 4× the token efficiency of Opus, teams already running coding agents should benchmark it against their current stack. The caveat stands: test on a representative sample of your actual tasks. The hallucination regression is real and matters for the wrong workloads. For the right ones, the savings are hard to ignore.

Get API access at x.ai/api. Full model documentation at docs.x.ai/developers/grok-4-5. Cursor integration details at cursor.com/grok-4-5.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *