Skip to content
Sign in

Grok 4.5 is SpaceXAI's most intelligent model, with frontier performance in coding, knowledge work, and STEM.

Context window500K
ProviderGrok
Released2026/07/09

Playground

Pricing

The same model is available through multiple service channels — choose based on latency, reliability and cost.

Prices in $ / 1M tokens
To pick a channel, add a provider field to the request body, for example "provider": { "channel": "direct" }. Valid values are direct / stable / economical; omit it to use the default channel.

Direct

Direct upstream connection — best when you need native behavior and the full context window.

InputOutputCache read
2.00/M6.00/M0.50/M

Overview

Input
Text Image
Output
Text

Grok 4.5 API: Cost-Effective Frontier Coding and Agent Model

Grok 4.5 is xAI's latest flagship model released in July 2026, reaching frontier-level performance in coding, knowledge work, and STEM. What's most striking isn't just its capability, but the capability-to-cost ratio — in multiple real-world work evaluations, it competes head-on with top closed-source models while costing an order of magnitude less.

Grok 4.5's training used real Cursor development session data, and its evaluation criteria are designed around "what AI can actually accomplish when working for long periods of time in a real codebase." This gives it a practical advantage in long-session coding tasks that doesn't fully align with traditional benchmark scores.

SeaWhale AI offers Grok 4.5 through an OpenAI-compatible interface, supporting tool calling, streaming output, and multimodal input.

Get API Key · Model ID: grok-4.5


Why Choose Grok 4.5

  • SWE Marathon leader — 29.0% resolution rate, surpassing Claude Opus 4.8 (26.0%) and Fable (24.0%)
  • Terminal-Bench 2.1 83.3% — execution capability in real terminal environments ranks in the top tier
  • Extremely high token efficiency — ~1.9M tokens per task on average, far lower than GPT-5.5 (6.2M) and Fable 5 (7.2M)
  • Outstanding real professional work performance — 29% average pass rate in Snorkel AI's GDPval+ evaluation, ahead of GPT-5.5 (22%) and Opus 4.8 (21%)
  • 500K token context — large codebases and long sessions fit at once

Core Capabilities

01 Long-Session Coding in Real Codebases

Grok 4.5 is trained on real Cursor development session data, with the optimization target of "working for long periods of time in real projects." This is reflected in its lead on long-horizon benchmarks like SWE Marathon, and in fewer detours and reworks in actual use.

  • Goal consistency in long sessions
  • Cross-file modifications and dependency handling
  • Actual execution in terminal environments

02 Ultimate Token Efficiency

xAI claims a 2x token efficiency improvement. At ~1.9M tokens per task on average, compared to competitors that often consume six to seven million, the same budget can run more tasks — a direct cost advantage in usage-based production environments.

  • Less exploration and repeated reasoning
  • More focused tool calls
  • Significantly lower total cost on long tasks

03 Professional Domain Work

In Snorkel AI's GDPval+ real professional task evaluation, Grok 4.5's lead is most pronounced in law (40% vs 27–28%) and medical (35% vs 23–25%).

  • Legal document analysis and compliance review
  • Medical and life sciences document processing
  • Cross-domain professional knowledge work

04 STEM and Knowledge Reasoning

Frontier-level performance on math, physics, and engineering reasoning tasks; combined with a 500K token context, it can handle complete technical document collections.

  • High-difficulty math and scientific reasoning
  • Comprehensive technical document analysis
  • Engineering calculation and validation

Best Use Cases

Scenario Description
Long-session coding Development tasks spanning long periods in real codebases
Cost-sensitive agents Automation workflows that require many calls but have limited budgets
Legal and medical analysis The two professional domains with the clearest advantage in GDPval+
STEM reasoning High-difficulty problems in math, physics, and engineering
Terminal automation Real command-line tasks corresponding to high Terminal-Bench scores
Large-scale production deployment Overall cost advantage from token efficiency

Grok 4.5 vs. Claude Opus 4.8 and GPT-5.5

Capability Grok 4.5 Claude Opus 4.8 GPT-5.5
Model ID grok-4.5 claude-opus-4-8 gpt-5.5
Vendor xAI Anthropic OpenAI
SWE Marathon 29.0% 26.0%
Terminal-Bench 2.1 83.3% 82.7% (2.0)
GDPval+ average pass rate 29% 21% 22%
Average tokens per task ~1.9M ~6.2M
Context window 500K tokens 1M tokens 1M+ tokens

For specific billing, refer to the real-time price card at the top of the page.


How to Use the Grok 4.5 API

1. Create a SeaWhale AI API key Generate a key in the console and top up your balance.

2. Try it on long tasks first Grok 4.5's strengths lie in long sessions and token efficiency; short one-off tasks won't show the difference. We recommend comparing it directly on real multi-step coding tasks.

3. Call the API

curl -X POST https://api.seawhaleai.com/v1/chat/completions \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "grok-4.5",
    "messages": [
      {"role": "user", "content": "Implement a user permission module in this repository, including data models, APIs, and tests."}
    ],
    "stream": true
  }'

FAQ

When was Grok 4.5 released? Released on July 8, 2026.

Where are its real advantages? First, long-session coding (SWE Marathon 29.0%, leading Opus 4.8 and Fable); second, token efficiency (~1.9M tokens per task on average, less than a third of GPT-5.5); and third, a price tier significantly lower than comparable competitors.

Are there benchmarks where it lags behind? Yes. On xAI's own coding agent index, Grok 4.5 scores 76, tied with GPT-5.5 in Codex and 1 point below Fable 5 in Claude Code — but at only a fraction of the cost.

How large is the context window? 500K tokens, with a maximum output of 128K tokens.

Does it support image input? Yes. Both text and image inputs are supported, with text output.

What scale of deployment is it suitable for? The token efficiency advantage becomes more pronounced as call volume grows, making it especially suitable for production environments that need to deploy agents at scale.


Why Choose SeaWhale AI for Grok 4.5 API

  • No overseas account needed — direct connection in China, no need to set up your own proxy
  • OpenAI-compatible interface — integrate by changing just two lines of existing code
  • Cross-vendor comparison — directly compare prices and performance with Claude, GPT, and Gemini under the same account
  • Unified billing — centrally manage usage and spending across multiple models

API

API integration

Model IDUse this value as the model in inference requests
grok-4.5
API KeyBearer token used to authenticate inference requests
Base URLOpenAI compatible · /chat/completions
OpenAIhttps://api.seawhaleai.com/v2/
provider OptionalSelects a service channel; omit it and the system picks the default
"provider": { "channel": "direct" }

grok-4.5 usage examples

SeaWhale AI is compatible with the OpenAI API protocol, so you can call it with the OpenAI SDK or plain HTTP requests. Streaming is enabled by default.

About the provider parameter (optional, a SeaWhale AI extension): most models are served over several channels that differ slightly in price and reliability. Add a provider field to the request body to pick one; omit it and the system selects the default channel — normal calls are unaffected.

provider is not part of the official OpenAI protocol — it is a SeaWhale AI extension that only takes effect on this platform. The OpenAI SDK allows custom fields like this to pass through; see the examples below.

ValueChannelBest for
directDirectThe official upstream link, for native behavior and the full context window
stablePreferredBalanced availability and speed — a good default for production traffic
economicalEconomyCost first, well suited to batch processing and price-sensitive workloads

Available channels and their prices are listed under "Pricing" above (channels vary by model). Additional notes:

  • Syntax: "provider": { "channel": "direct" }.
  • If the requested channel is not enabled for that model, the request automatically falls back to the default channel and returns normally — it does not error.
  • With the official SDKs: in Python pass it via extra_body; in Node.js put it directly on the request object and it passes through. In TypeScript projects, add a // @ts-expect-error line to skip the type check.
js
curl https://api.seawhaleai.com/v2/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API_KEY>" \
  -d '{
    "model": "grok-4.5",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello!"}
    ],
    "provider": { "channel": "direct" },
    "stream": true
  }'
# provider is optional — remove this line to use the default channel
js
from openai import OpenAI

client = OpenAI(
    base_url="https://api.seawhaleai.com/v2",
    api_key="<API_KEY>",
)

stream = client.chat.completions.create(
    model="grok-4.5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"},
    ],
    stream=True,
    # Optional: pick a service channel; omit to use the default
    extra_body={"provider": {"channel": "direct"}},
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
js
import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://api.seawhaleai.com/v2',
  apiKey: '<API_KEY>',
})

const stream = await client.chat.completions.create({
  model: 'grok-4.5',
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Hello!' },
  ],
  stream: true,
  // Optional: pick a service channel; omit to use the default
  // @ts-expect-error provider is a SeaWhale AI extension, not in the OpenAI SDK types
  provider: { channel: 'direct' },
})

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? '')
}