Grok 4.3 API for Agents (May 2026): Pricing, Benchmarks, Migration

Grok 4.3 API for Agents (May 2026): Pricing, Benchmarks, and How to Migrate from Claude or OpenAI in 5 Minutes
xAI released Grok 4.3 to the public API on May 5, 2026 at $1.25 per million input tokens and $2.50 per million output tokens, roughly 4x cheaper on input and 10x cheaper on output than Claude Opus 4.7 (per Artificial Analysis). It ships with 1M context, native function calling, structured output, and #1 on the Artificial Analysis agentic tool-calling leaderboard. This guide covers what's new, the real benchmarks, and how to migrate from Anthropic or OpenAI without rewriting your tool layer.
TL;DR
Grok 4.3 GA: May 5-6, 2026, via api.x.ai
Pricing: $1.25 input / $2.50 output per 1M tokens
Context: 1M tokens, requests over 200K billed at higher rate
#1 on Artificial Analysis agentic tool-calling leaderboard
Drop-in compatible with the OpenAI SDK (change base_url + model)
What is the Grok 4.3 API and what changed from 4.2?
The Grok 4.3 API is xAI's chat-completions endpoint for the Grok 4.3 frontier model, exposed at https://api.x.ai/v1. Versus Grok 4.20 it adds a 1M context window (up from 256K), drops input price about 40% and output price about 60%, ships always-on reasoning, and adds native video input alongside the existing text and image modalities, per the VentureBeat launch coverage.
Rollout: beta April 17, paid-dev API access April 30, GA May 5-6 with companion Voice API and Imagine (image/video) API. On May 6 xAI emailed devs that eight legacy models retire May 15, 2026, per the model-retirement notice.
What's actually new beyond price:
1M context, up from 256K on Grok 4.20, per the model page.
Always-on reasoning. No per-call toggle.
Remote MCP server connections, alongside web search and code execution.
Native video input, a first for the Grok line.
The launch was Musk-tweet-driven, not a formal x.ai/news post. Engagement figures cited in recaps (about 9.7K likes, 1.1K reposts, 77M views on the @xai announcement) couldn't be independently verified at the time of writing.
How much does Grok 4.3 API cost per million tokens?
Grok 4.3 costs $1.25 per million input tokens and $2.50 per million output tokens at the standard tier, per the xAI Grok 4.3 docs. That's roughly 4x cheaper than Claude Opus 4.7 on input and 10x cheaper on output. Requests above 200K total tokens are billed at a higher long-context rate, so chunk wisely.
Model | Input ($ / 1M tok) | Output ($ / 1M tok) | Context | Source |
|---|---|---|---|---|
Grok 4.3 | $1.25 | $2.50 | 1M | |
Claude Opus 4.7 | $15.00 | $75.00 | 1M (1M tier) | Anthropic pricing page |
GPT-5.5 (standard, short ctx) | $5.00 | $30.00 | ~1M (922K in) | |
GPT-5.5 Batch / Flex | $2.50 | $15.00 | same | |
Grok 4.3 (long ctx, >200K req) | ~2x standard | ~1.5x standard | 1M |
"Cheap per token" doesn't mean "cheap per task." The Register's May 8, 2026 analysis showed GPT-5.5 burning fewer tokens than 5.4 but costing more per query. Run a small per-task spend test on your real workload before committing. GPT-5.5 long-context (>272K input) also doubles input rates and 1.5x output for the entire session. Our Agent 365 vs Claude Managed Agents cost comparison covers how to model per-task numbers for 30-100 tool calls per session.
What are Grok 4.3's agentic tool-calling benchmarks?
Grok 4.3 ranks #1 on the Artificial Analysis agentic tool-calling and instruction-following leaderboards as of May 2026, scores 98% on tau2-Bench Telecom, and posts a 1500 ELO on GDPval-AA (up 321 points from Grok 4.20 v2's 1179), per Artificial Analysis. It also ranks #1 on Vals AI enterprise benchmarks for case law (79.3%) and corporate finance.
Benchmark | Grok 4.3 | Comparator | Source |
|---|---|---|---|
Artificial Analysis Agentic Tool Calling | #1 | Top of leaderboard | |
tau2-Bench Telecom | 98% | +5 pts vs prior; tied with GLM-5.1 | |
GDPval-AA (ELO) | 1500 | Beats Gemini 3.1 Pro Preview, Muse Spark, GPT-5.4 mini xhigh, Kimi K2.5 | |
AA Intelligence Index | 53 | GPT-5.5: 60, Opus 4.7: 57, Gemini 3.1 Pro Preview: 57 | |
Vals CaseLaw v2 | 79.3% | #1 published | |
Kilo Coding Index | 41.0 | Opus 4.7 leads SWE-bench Verified at 87.6% |
Grok 4.3 is the agent-calling and enterprise-knowledge leader at this price point but trails GPT-5.5 and Opus 4.7 on the general-intelligence index and trails Opus 4.7 on coding benchmarks. xAI's own framing is "best for agentic tool calling," not "best at everything." For long agent loops with 20-100 tool calls per session, the tau2 and GDPval gains compound. For one-shot code refactoring, see our DeepSeek V4 Pro vs Claude Opus 4.7 refactor benchmark.
How do I sign up and get an API key?
Sign up at console.x.ai, add a payment method, and create an API key from the API Keys page. New accounts start at the standard tier; higher tiers enable by cumulative spend or by support request.
Sign in at console.x.ai with an X or Google account.
Add a payment method under Billing (xAI requires a card before key issuance, per the Getting Started tutorial).
Open API Keys, Create Key, copy the value (xAI won't show it again).
Export it as
XAI_API_KEYon your dev machine and deploy target.
Smoke test with curl:
curl https://api.x.ai/v1/chat/completions \
-H "Authorization: Bearer $XAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-4.3","messages":[{"role":"user","content":"ping"}],"max_tokens":10}'HTTP 401 means the key is wrong or not yet propagated (wait 30 seconds). HTTP 429 means rate-limited; see the rate-limits section below.
How do I make my first Grok 4.3 API call (Python and Node)?
The fastest path is the OpenAI SDK with base_url changed to https://api.x.ai/v1 and model set to grok-4.3. Same shape works in Python and Node. xAI also ships a native xai_sdk Python package.
Python (OpenAI-compatible):
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["XAI_API_KEY"],
base_url="https://api.x.ai/v1",
)
response = client.chat.completions.create(
model="grok-4.3",
messages=[
{"role": "system", "content": "You are a senior systems engineer."},
{"role": "user", "content": "Explain TCP slow start in 3 sentences."},
],
)
print(response.choices[0].message.content)Python (xAI native SDK):
import os
from xai_sdk import Client
from xai_sdk.chat import user, system
client = Client(api_key=os.environ["XAI_API_KEY"])
chat = client.chat.create(model="grok-4.3")
chat.append(system("You are a senior systems engineer."))
chat.append(user("Explain TCP slow start in 3 sentences."))
response = chat.sample()
print(response.content)Node (OpenAI-compatible path):
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.XAI_API_KEY,
baseURL: "https://api.x.ai/v1",
});
const response = await client.chat.completions.create({
model: "grok-4.3",
messages: [
{ role: "system", content: "You are a senior systems engineer." },
{ role: "user", content: "Explain TCP slow start in 3 sentences." },
],
});
console.log(response.choices[0].message.content);Expect a 200 with non-empty choices[0].message.content in 1-3 seconds for a short prompt. If it hangs over 10 seconds, check that base_url ends in /v1 (no trailing slash; some HTTP clients double-path).
How do I migrate from the Anthropic SDK to xAI?
The Anthropic SDK uses a Messages API shape (with system as a top-level parameter and content blocks for tool use); xAI uses OpenAI-shape Chat Completions. The cleanest migration is to swap to the OpenAI SDK pointed at the xAI base URL, which means rewriting the call site but keeping your tool definitions in OpenAI function-calling shape.
Before (Anthropic):
import os
from anthropic import Anthropic
client = Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=1024,
system="You are a senior systems engineer.",
messages=[
{"role": "user", "content": "Explain TCP slow start in 3 sentences."},
],
)
print(response.content[0].text)After (xAI via OpenAI SDK):
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["XAI_API_KEY"],
base_url="https://api.x.ai/v1",
)
response = client.chat.completions.create(
model="grok-4.3",
max_tokens=1024,
messages=[
{"role": "system", "content": "You are a senior systems engineer."},
{"role": "user", "content": "Explain TCP slow start in 3 sentences."},
],
)
print(response.choices[0].message.content)Three things to watch:
System prompt placement. Anthropic uses
system=kwarg; xAI uses a{"role": "system"}first message.Tool-use format. Anthropic's
tool_use/tool_resultcontent blocks flatten into OpenAI-shapetools+tool_calls. Parameters JSON is the same; wrapping differs.Caching. Anthropic's
cache_controlhas no current xAI equivalent, so cache-heavy workloads may see spend shift either way depending on hit rate.
For agent-orchestration patterns that translate cleanly to Grok, see our Claude Code subagents context-saving patterns.
How do I migrate from the OpenAI SDK?
Migration from OpenAI to Grok 4.3 is two lines: change base_url and change model. Function calling, structured output, and streaming all behave identically because the wire protocol is the same OpenAI Chat Completions shape, per the xAI API overview.
Before (OpenAI):
from openai import OpenAI
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
response = client.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Hello"}],
tools=my_tool_schema,
)After (xAI):
from openai import OpenAI
client = OpenAI(
api_key=os.environ["XAI_API_KEY"],
base_url="https://api.x.ai/v1",
)
response = client.chat.completions.create(
model="grok-4.3",
messages=[{"role": "user", "content": "Hello"}],
tools=my_tool_schema,
)That's the whole migration. Tool schemas pass unchanged. Streaming (stream=True) and structured output (response_format={"type": "json_schema",...}) behave identically. One real gotcha: xAI uses dotted model ids (grok-4.3); OpenAI uses dash separators. Normalize if you have a router config.
When should you use Grok 4.3 instead of Claude Opus 4.7?
Use Grok 4.3 for long agent loops with frequent tool calls, large-context retrieval, or enterprise knowledge work (legal, finance) where Vals AI puts it #1. Stay on Claude Opus 4.7 for software engineering against real codebases, where Opus 4.7's 87.6% on SWE-bench Verified still leads, per Apiyi's comparison.
Decision rules:
Agent with 20+ tool calls/session. Grok 4.3. Tool-calling lead + 4x-10x cost advantage compounds.
RAG over 500K-1M tokens. Grok 4.3 (note: >200K hits long-context rate).
Coding agent against 50K+ line repo. Opus 4.7. See our Claude Code doubled limits coverage.
Mixed workload. Route per-request: tool calls to Grok, coding to Opus.
If you want to compare Grok API costs against self-hosted alternatives, GPU hosts like RunPod, Lambda Labs, and TensorDock run Hermes, DeepSeek, and Mistral cheaply. A rented H100 at ~$2.39/hr running Hermes can beat per-token API spend after ~30M tokens/day; bursty workloads still favor the API.
What are the rate limits and tiers?
Each xAI account is placed in a tier based on cumulative spend, and each tier sets hard requests-per-minute (RPM) and tokens-per-minute (TPM) caps per model, per the xAI Consumption and Rate Limits docs. Hitting either limit returns HTTP 429. Production workloads typically reach 4M TPM at higher tiers.
What | Where to check | How to raise |
|---|---|---|
Per-model RPM | xAI Console > Models page (per-team) | Spend more, or request via support |
Per-model TPM | xAI Console > Models page (per-team) | Spend more, or request via support |
Long-context billing trigger | 200K tokens per request | Chunk inputs below 200K |
Standard tier ceiling | Up to 4M TPM at higher tiers per xAI docs | Move tier or split keys per workload |
429 backoff guidance | Exponential backoff with jitter | Honor |
xAI does not publish a static tier table the way OpenAI used to; your console model page shows current numbers. For multi-tenant agent platforms on Grok 4.3, plan for per-tenant key rotation early; a single team key bottlenecks at modest production volume.
FAQ
Is Grok 4.3 OpenAI-compatible?
Yes for Chat Completions. The https://api.x.ai/v1 endpoint mirrors OpenAI's Chat Completions wire protocol, so the OpenAI Python or Node SDK works by changing only base_url and model id, per the xAI API overview. Function calling, response_format structured output, and stream=True all behave the same. Anthropic Messages API shape does not work; you need a shim or to migrate to Chat Completions.
What is the Grok 4.3 context window?
1,000,000 tokens, per the official model page: a 4x jump from Grok 4.20's 256K. Requests above 200K total tokens are billed at a higher long-context rate, so chunk and retrieve where you can rather than stuffing whole repos in.
How does Grok 4.3 handle function calling?
OpenAI-shape: pass tools=[{"type": "function", "function": {...}}], the model returns tool_calls in the assistant message, you execute the tool and append a {"role": "tool",...} message with the result. Grok 4.3 ranks #1 on the Artificial Analysis agentic tool-calling leaderboard at 98% on tau2-Bench Telecom. Remote MCP server connections are supported.
Is Grok 4.3 cheaper than Claude Opus 4.7?
Yes per token. Grok 4.3 is $1.25 in / $2.50 out per million; Opus 4.7 is $15 / $75: ~4x cheaper input, ~10x cheaper output. Whether it's cheaper per task depends on quality. For agent loops with many tool calls Grok wins on both axes; for hard coding tasks Opus may complete in fewer attempts and recover the spend.
What models are being retired on May 15, 2026?
xAI emailed paid developers on May 6, 2026 that eight legacy Grok API models retire May 15, including older Grok 4 variants and Grok 4.20 stepping stones, per the retirement notice. Migrate pinned older model ids to grok-4.3 (or grok-4.1-fast for cheaper) before May 15 or calls will fail.
References
xAI, Grok 4.3 model page docs.x.ai/developers/models/grok-4.3
xAI, Models and Pricing docs.x.ai/developers/models
xAI, Consumption and Rate Limits docs.x.ai/docs/key-information/consumption-and-rate-limits
xAI, Getting Started tutorial docs.x.ai/docs/tutorial
xAI, API overview docs.x.ai/overview
Artificial Analysis, "xAI launches Grok 4.3 with improved agentic performance and lower pricing" artificialanalysis.ai
Artificial Analysis, Grok 4.3 model page artificialanalysis.ai/models/grok-4-3
VentureBeat, "xAI launches Grok 4.3 at an aggressively low price..." venturebeat.com
Apiyi, "Grok 4.3 launches on xAI API: complete migration guide" help.apiyi.com
Apiyi, "Grok 4.3 vs Claude Opus 4.7 programming comparison" help.apiyi.com
Kilo, Grok 4.3 in Kilo Code coding index kilo.ai/models/x-ai-grok-4-3
OpenRouter, GPT-5.5 cost analysis openrouter.ai/announcements/gpt55-cost-analysis
OpenAI, API pricing developers.openai.com/api/docs/pricing
The Register, "GPT-5.5 may burn fewer tokens but costs more cash" theregister.com
Vantaige, Agent 365 vs Claude Managed Agents cost comparison vantaige.io/blog/agent-365-vs-claude-managed-agents-cost-comparison-2026
Vantaige, DeepSeek V4 Pro vs Claude Opus 4.7 refactor benchmark vantaige.io/blog/deepseek-v4-pro-vs-claude-opus-4-7-refactor-benchmark-2026
Vantaige, Claude Code subagents save context patterns vantaige.io/blog/claude-code-subagents-save-context-3-patterns
Vantaige, Claude Code doubled limits May 2026 SpaceX deal vantaige.io/blog/claude-code-doubled-limits-may-2026-spacex-deal
Related from Vantaige
Get the best new AI tools and guides, weekly
One short email a week. The tools worth trying, the guides worth reading, nothing else.
No spam. Unsubscribe anytime.
Aymen B
Contributing writer at Vantaige, covering the AI tools ecosystem.


