dbotmakerthe decision bot

Review · Software & AI

xAI API review

xAI's API for Grok 4.7 plus voice, image and video models, with tiered rate limits based on spend.

By the DBotMaker research desk · Updated November 24, 2026

Short answer · output

The xAI API is the pay-per-token developer service for Grok models, plus voice, image and video generation, from the company its docs now call SpaceXSI. As checked in November 2026, Grok 4.7 costs $2.00 per 1M input tokens and $6.00 per 1M output tokens with a 500,000-token context window, and Grok 4.3 costs $1.25 and $2.50 with 1M. It suits teams that generate a lot of output or need search over X posts, while cache-heavy agents and large batch jobs can cost less elsewhere.

Capabilities (40%)
8.5
Ease of setup (30%)
8.7
Value (30%)
8.6

In pictures · 3 images

Fig 01 · docs.x.ai/developers/models
xAI API: The models page in xAI's documentation with Grok 4.7 and per-token prices
The models page in xAI's documentation with Grok 4.7 and per-token prices. Source, checked Nov 24, 2026: docs.x.ai/developers/models
Fig 02 · docs.x.ai/developers/pricing
xAI API: The pricing page covering text, image, video, voice and tool rates
The pricing page covering text, image, video, voice and tool rates. Source, checked Nov 24, 2026: docs.x.ai/developers/pricing
Fig 03 · docs.x.ai/developers/rate-limits
xAI API: The rate limits page with spend tiers and per-model limits
The rate limits page with spend tiers and per-model limits. Source, checked Nov 24, 2026: docs.x.ai/developers/rate-limits

Verdict printout · xAI API


The xAI API is a good fit for developers who want a flagship model with low output prices, built-in X search and high starting rate limits: Grok 4.7 charges $6.00 per 1M output tokens, against $10.00 for both Claude Sonnet 5.5 and GPT-6.2 Sol at the same $2.00 input rate. It is a weaker choice for agents that resend long cached prompts, because cached input costs $0.50 on Grok 4.7 against $0.10 on those two rivals, and for offline jobs, because its batch discount is 20% where Anthropic and OpenAI take 50%. The deciding fact is the shape of the workload: the more output and the fewer cached tokens per request, the better xAI's prices look.

ReadOverview

The xAI API gives programs access to Grok models through keys created in the xAI console. It shares a login with the Grok consumer app, but the billing is separate, so API usage has to be funded with its own credits. The catalog covers text and reasoning models, image and video generation, speech to speech, speech to text and text to speech. The domain, console and SDK still use the xAI name, while the documentation refers to the company as SpaceXSI.

The text line-up changed three times in the second half of 2026. Release notes list Grok 4.5 in July, Grok 4.6 in August and Grok 4.7 in September, all at $2.00 in and $6.00 out. Grok 4.7 has a May 2026 knowledge cutoff, accepts text and images, returns text, and offers low, medium, high and xhigh reasoning effort, with high as the default. Grok Voice 3.0 followed in October at the same $0.08 per minute as Voice 2.0, which is now deprecated. The coding model grok-build-0.1 reached end of life on November 19, and xAI now points coding work to Grok 4.7.

Headline prices hide a threshold. When a prompt reaches 200,000 tokens, every token in that request is billed at the higher rate: $4.00 in and $12.00 out on Grok 4.7, $2.50 and $5.00 on Grok 4.3. With prompts below that line, a workload of 1M input and 200,000 billed output tokens works out to $1.75 on Grok 4.3, $3.00 on Gemini 4 Hydrogen, $3.20 on Grok 4.7 and $4.00 on Claude Sonnet 5.5 or GPT-6.2 Sol. Reasoning tokens are billed, so default high effort can raise the output count.

Caching and batch work change the order. If 900,000 of 1M input tokens are cache hits and output is only 20,000 tokens, Grok 4.7 comes to $0.77, while GPT-6.2 Sol at $0.10 cached input comes to about $0.49 before any cache write charge. In batch, the 1M input and 200,000 output job costs $2.56 on Grok 4.7 after 20% off and $2.00 on Sonnet 5.5 or GPT-6.2 Sol after 50% off. These are calculations from list prices with equal token counts; models use different tokenizers and different amounts of reasoning, and prices do not show which answer is better.

Context is a trade. Grok 4.7, 4.6 and 4.5 stop at 500,000 tokens, half the 1M that Anthropic and Google list for their current flagships. The older Grok 4.3 and Grok 4.20 models list 1M and cost less, though xAI recommends Grok 4.7 for code and chat. For large volumes of simple prompts the xAI range has no small model: Claude Haiku 5.5 lists $0.10 in and $0.50 out for prompts up to 100,000 tokens, which is 12.5 times cheaper on input than Grok 4.3.

The operational limits matter too. Credits are prepaid by default, refunds are not offered except where law requires them, and requests are rejected when credits run out. Grok has no knowledge of current events unless search tools are switched on, and those tools are billed on top of tokens. Retired model names keep resolving but may redirect to a model at another price: after May 15, 2026, calls to grok-3 and several Grok 4 fast models were sent to Grok 4.3 and billed at its rates. Teams that need fixed behavior should use a dated model name where one is published.

How it scored

xAI keeps its API simple: Grok 4.7 is the recommended model for code, chat and everything else outside media. It costs $2.00 per 1M input tokens and $6.00 per 1M output tokens with a 500K-token context and configurable reasoning, which makes output cheaper than most flagship rivals. Server-side tools cover web search, X search, code execution and remote MCP, and the platform adds a batch API, deferred completions, prompt caching and regional endpoints. A Voice API and Imagine API handle speech, images and video. Rate limits scale through tiers based on cumulative spend since January 1, 2026: Tier 0 at $0, then $50, $250, $1,000 and $5,000, and xAI says tiers never downgrade. The gaps are a missing budget model for high-volume tasks and a context window half the size of the leaders. Grok also has no knowledge of current events unless search tools are on.

Who it is for

Teams that want one flagship model and simple choices

Run it if

  • Teams that generate long answers, code or reports, where $6.00 per 1M output tokens on Grok 4.7 undercuts the $10.00 of Claude Sonnet 5.5 and GPT-6.2 Sol
  • Social listening and news products that need a model to search X posts, profiles and threads through a documented tool
  • New projects that expect traffic bursts, since Tier 0 already lists 150 requests per second and 50M tokens per minute on Grok 4.7
  • Developers with code built on the OpenAI SDK who want to try Grok by changing the base URL, key and model name
  • Voice app builders who prefer a per-minute price: $0.08 per minute for speech to speech on grok-voice-3.0

Skip it if

  • Agent builders who resend long stable prompts: the Anthropic API and OpenAI API list cached input at $0.10 per 1M tokens on Sonnet 5.5 and GPT-6.2 Sol, against $0.50 on Grok 4.7
  • High-volume classification or extraction on short prompts: Claude Haiku 5.5 in the Anthropic API lists $0.10 in and $0.50 out
  • Developers who need a documented free tier: the Google Gemini API offers Gemini 4 Hydrogen free within rate limits
  • Teams that want downloadable weights and a choice of hosts: Groq and Together AI serve open models

SpecSpec sheet

xAI API specifications with sources
Flagship modelGrok 4.7 (grok-4.7)src ↗
Context window500,000 tokens on Grok 4.7, 4.6 and 4.5; 1M on Grok 4.3 and Grok 4.20src ↗
Grok 4.7 modalitiesText and image in, text outsrc ↗
Grok 4.7 output limitNo text output limit stated by xAIsrc ↗
Knowledge cutoff (Grok 4.7)May 2026src ↗
Reasoning effort (Grok 4.7)Low, medium, high (default), xhighsrc ↗
Image inputJPG or PNG, up to 20 MiB each, no limit on countsrc ↗
Long-context threshold200,000 prompt tokens; all tokens in the request are then billed at double ratessrc ↗
Tier 0 limits (Grok 4.7)150 requests per second, 50M tokens per minutesrc ↗
Tier 4 limits (Grok 4.7)500 requests per second, 100M tokens per minutesrc ↗
Tier thresholds$0, $50, $250, $1,000 and $5,000 cumulative spend since January 1, 2026src ↗
Batch API20% off listed text models; most jobs finish within 24 hours, not guaranteedsrc ↗
Batch file limits200 MB and 50,000 requests per filesrc ↗
Priority processing2x standard token ratessrc ↗
US regional endpointGrok 4.7 and 4.6 only, at 1.1x token ratessrc ↗
Default data retention30 days, encrypted at rest; no training without explicit permissionsrc ↗

Price

Pay as you go; Grok 4.7 costs $2.00 per 1M input tokens and $6.00 per 1M output tokens.

grok-4.7 Our flagship model for code and everything else: agentic tool calling, minimal hallucinations, configurable reasoning. Context 500k tokens Input $2.00 / 1M tokens
Quoted from the vendor pricing page on November 16, 2026.

Plans on file · 16

xAI API plans and prices with sources and check dates
Grok 4.7$2.00 in, $6.00 out; $4.00 in, $12.00 out for prompts of 200,000 tokens or morePer 1M tokens, pay as you go500,000-token context; Cached input $0.50, or $1.00 long context; 20% batch discountChecked Nov 24, 2026
Grok 4.6$2.00 in, $6.00 out; $4.00 in, $12.00 out for prompts of 200,000 tokens or morePer 1M tokens, pay as you go500,000-token context; Cached input $0.50, or $1.00 long context; 20% batch discountChecked Nov 24, 2026
Grok 4.5$2.00 in, $6.00 out; $4.00 in, $12.00 out for prompts of 200,000 tokens or morePer 1M tokens, pay as you go500,000-token context; Cached input $0.30, or $0.60 long context; 20% batch discountChecked Nov 24, 2026
Grok 4.3$1.25 in, $2.50 out; $2.50 in, $5.00 out for prompts of 200,000 tokens or morePer 1M tokens, pay as you go1M context; Cached input $0.20, or $0.40 long context; 20% batch discountChecked Nov 24, 2026
Grok 4.20 (reasoning and non-reasoning)$1.25 in, $2.50 out; $2.50 in, $5.00 out for prompts of 200,000 tokens or morePer 1M tokens, pay as you go1M context; Cached input $0.20, or $0.40 long context; Two dated model names: 0309-reasoning and 0309-non-reasoningChecked Nov 24, 2026
Grok 4.20 multi-agent$1.25 in, $2.50 out; $2.50 in, $5.00 out for prompts of 200,000 tokens or morePer 1M tokens, pay as you go1M context; Several agents cooperate on research; the feature is in beta; Tier 0 limit of 9 requests per secondChecked Nov 24, 2026
US regional endpoint (Grok 4.7)$2.20 in, $6.60 out; $4.40 in, $13.20 out for prompts above 200,000 tokensPer 1M tokens, pay as you goInference in the United States; Cached input $0.55, or $1.10 long contextChecked Nov 24, 2026
Grok Imagine image$0.02 per imagePer imagegrok-imagine-imageChecked Nov 24, 2026
Grok Imagine image 2.0From $0.04 per imagePer imageLow quality costs $0.04 at 1K and $0.06 at 2K; Edits add $0.01 per input image at low qualityChecked Nov 24, 2026
Grok Imagine video$0.050 per secondPer secondgrok-imagine-videoChecked Nov 24, 2026
Grok Imagine video 1.5$0.080 per secondPer secondgrok-imagine-video-1.5Checked Nov 24, 2026
Grok Imagine video 1.5 Lite$0.020 per secondPer secondgrok-imagine-video-1.5-liteChecked Nov 24, 2026
Speech to speech (grok-voice-3.0)$0.08 per minute plus $0.004 per text inputPer minute10 concurrent sessions at Tier 0; grok-voice-2.0 is deprecated at the same priceChecked Nov 24, 2026
Speech to text$0.10 per hour (REST), $0.20 per hour (streaming)Per audio hourRedaction adds $0.05 per hour on the model pageChecked Nov 24, 2026
Text to speech$15.00 per 1M charactersPer characterStreaming and batch outputChecked Nov 24, 2026
EnterprisePrice not listedContact salesCustom rate limits on requestChecked Nov 24, 2026

Key features

Server-side web and X search

Grok can call web search and X search during a request. Web search costs $5 per 1,000 calls. X search is billed by what it fetches: $5 per 1,000 posts and $10 per 1,000 profiles, and parent and quoted posts count. Token charges are added.

Code execution, files and remote MCP

Code execution and attachment search cost $5 per 1,000 calls, and collections search costs $2.50. Remote MCP tools carry no invocation fee from xAI and are billed through tokens. Because the model decides how many tools to call, cost per request varies.

OpenAI SDK compatibility

The documentation shows the OpenAI Python and JavaScript libraries running against https://api.x.ai/v1. The Responses API is the main interface; Chat Completions still works but is labeled legacy, and new features go to Responses first.

Rate limits that only rise

A team moves up automatically at $50, $250, $1,000 and $5,000 of cumulative spend since January 1, 2026, and keeps the tier permanently. Cached tokens still count toward the tokens-per-minute limit.

Structured outputs

A JSON schema can be supplied in the request, and xAI says responses are guaranteed to match when supported schema features are used. Tool call arguments follow their schema as well, with strict mode always on.

Voice API

Grok Voice 3.0 runs real-time conversations at $0.08 per minute with function calling, web search and MCP, up to 120 minutes per session. With the default server_vad turn detection, sessions are billed for their duration. Transcription covers 38+ languages, and generated speech carries an inaudible AudioSeal watermark.

Zero data retention switch

A team admin can turn on zero data retention in the console where it is available. It applies to the whole team and disables the Batch API, Files, Collections, deferred completions and stateful Responses. xAI does not recommend it for most customers.

Cloud marketplace access

xAI documents Grok on Google Cloud Vertex AI and on Microsoft Foundry, billed through those clouds. Model gateways listed for Grok 4.7 are OpenRouter, Vercel and Cloudflare.

Strengths and weaknesses

Plus · 7

  • Grok 4.7 output at $6.00 per 1M tokens is 40% below the $10.00 list price of Claude Sonnet 5.5 and GPT-6.2 Sol, with input equal at $2.00
  • Grok 4.3 offers 1M context at $1.25 in and $2.50 out for prompts below 200,000 tokens
  • New teams start at 150 requests per second and 50M tokens per minute on Grok 4.7, with no spend needed to reach that tier
  • X search is a documented tool priced at $5 per 1,000 posts, which helps with questions about current public conversation
  • Text, image, video and three kinds of voice API sit under one account, with video from $0.020 per second
  • API data is not used for training without explicit permission and is deleted after 30 days by default
  • Tier upgrades are automatic from $50 of spend and never reversed

Minus · 6

  • Cached input on Grok 4.7 costs $0.50 per 1M tokens, 5 times the $0.10 of Claude Sonnet 5.5 and GPT-6.2 Sol
  • The batch discount is 20%, against 50% at Anthropic and OpenAI, and image and video jobs get none
  • Prompts of 200,000 tokens or more double the price of every token in the request
  • The 500,000-token window of Grok 4.7 is half that of Grok 4.3 and of leading 1M rivals, and there is no text model below $1.25 input
  • Prepaid credits are not refundable except where law requires it, and requests stop when the balance is used up
  • The US endpoint serves two text models at a 10% premium, and its guarantee excludes Files, Collections and server-side tools

Key facts

  • Grok 4.7: $2.00 in, $6.00 out per 1M tokens
  • Context: 500K tokens
  • Knowledge cutoff: May 2026
  • Rate limit tiers: Tier 0 at $0 to Tier 4 at $5,000 cumulative spend

Where it ranks

xAI API is No. 6 in our Best LLM APIs verdict.

AltAlternatives to weigh

  • Anthropic API →Claude Sonnet 5.5 matches the $2.00 input price, lists cached input at $0.10 and takes 50% off batch jobs, though output is $10.00.
  • OpenAI API →GPT-6.2 Sol lists $2.00 in, $0.10 cached and $10.00 out, with batch at half price, which favors cache-heavy agents.
  • Google Gemini API →Gemini 4 Hydrogen has a free tier, 1,048,576 tokens of context and paid rates of $1.50 in and $7.50 out.
  • DeepSeek API →deepseek-flash lists $0.15 in and $0.60 out per 1M tokens off-peak on cache misses, for budget workloads.
  • Groq →A separate company from Grok that hosts open models, including GPT OSS 120B at $0.15 in and $0.60 out on its developer plan.

Questions readers ask

QHow much does the xAI API cost?
AGrok 4.7 costs $2.00 per 1M input tokens, $0.50 per 1M cached input tokens and $6.00 per 1M output tokens for prompts under 200,000 tokens, as checked in November 2026. Longer prompts cost $4.00, $1.00 and $12.00. Grok 4.3 costs $1.25 in and $2.50 out below the same threshold.
QDoes the xAI API have a free tier?
ANo free token allowance is listed on xAI's pricing page, and the quickstart tells developers to load credits before starting. Rate limit Tier 0 has a $0 spend threshold, but that sets request limits and does not make usage free.
QIs the xAI API worth it?
AIt is worth considering for output-heavy work, because Grok 4.7 charges $6.00 per 1M output tokens against $10.00 for Claude Sonnet 5.5 and GPT-6.2 Sol. It is harder to justify on price for cache-heavy agents or batch jobs, where cached input is 5 times dearer and the batch discount is 20% instead of 50%.
QIs the xAI API included with a Grok or X subscription?
ANo, xAI says billing for Grok and for the API is separate, although the account login is shared. API usage is paid with credits in the xAI console.
QxAI API vs OpenAI API: which is cheaper?
AGrok 4.7 is cheaper on output at $6.00 per 1M tokens against $10.00 for GPT-6.2 Sol, and input is $2.00 on both. GPT-6.2 Sol is cheaper on cached input, $0.10 against $0.50, and in batch mode it lists $1.00 in and $5.00 out, against $1.60 and $4.80 for Grok 4.7 after the 20% discount.
QWhat is the context window of Grok 4.7?
AGrok 4.7 has a 500,000-token context window and no text output limit, according to xAI. Grok 4.3 and Grok 4.20 list 1M tokens. All of them charge double rates once a prompt reaches 200,000 tokens.
QDoes xAI train on API data?
AxAI says it never trains on API inputs or outputs without explicit permission. Requests and responses are stored for 30 days by default, encrypted at rest, and then deleted. Zero data retention can be enabled per team where available, at the loss of features such as the Batch API and Files.
QCan the OpenAI SDK be used with the xAI API?
AYes, xAI's docs show the OpenAI Python and JavaScript SDKs with the base URL https://api.x.ai/v1. Some parameters differ: logprobs and top_logprobs are silently ignored on grok-4.20 and newer models.

LogSource log

  1. [01]xAI docs: Pricing · checked Nov 24, 2026
  2. [02]xAI docs: Models · checked Nov 24, 2026
  3. [03]xAI docs: Rate limits · checked Nov 24, 2026
  4. [04]xAI docs: Release notes · checked Nov 24, 2026
  5. [05]xAI docs: Grok 4.7 · checked Nov 24, 2026
  6. [06]xAI docs: Security FAQ · checked Nov 24, 2026
  7. [07]xAI docs: Accounts FAQ · checked Nov 24, 2026
  8. [08]xAI docs: Billing FAQ · checked Nov 24, 2026
  9. [09]xAI docs: Manage billing · checked Nov 24, 2026
  10. [10]xAI docs: Quickstart · checked Nov 24, 2026
  11. [11]xAI docs: Batch API · checked Nov 24, 2026
  12. [12]xAI docs: Priority processing · checked Nov 24, 2026
  13. [13]xAI docs: Regional endpoints · checked Nov 24, 2026
  14. [14]xAI docs: Structured outputs · checked Nov 24, 2026
  15. [15]xAI docs: Chat Completions (legacy) · checked Nov 24, 2026
  16. [16]xAI docs: Multi-agent · checked Nov 24, 2026
  17. [17]xAI docs: May 15 model retirement · checked Nov 24, 2026
  18. [18]xAI docs: Image quality model retirement · checked Nov 24, 2026
  19. [19]xAI docs: Speech to speech · checked Nov 24, 2026
  20. [20]xAI docs: Speech to text · checked Nov 24, 2026
  21. [21]xAI docs: Grok on Vertex AI · checked Nov 24, 2026
  22. [22]xAI docs: Grok on Microsoft Foundry · checked Nov 24, 2026
  23. [23]Anthropic: Claude API pricing · checked Nov 24, 2026
  24. [24]OpenAI: API pricing · checked Nov 24, 2026
  25. [25]Google: Gemini API pricing · checked Nov 24, 2026
  26. [26]Google: Gemini 4 Hydrogen · checked Nov 24, 2026
  27. [27]DeepSeek: Models and pricing · checked Nov 24, 2026
  28. [28]Groq: Models · checked Nov 24, 2026

Deep review last updated November 24, 2026. Prices and specs are rechecked against these pages.

Alternatives we scored

Cite this page

DBotMaker. xAI API review. Updated November 24, 2026. https://dbotmaker.io/review/xai-api

Visit x.ai · Questions or corrections: editorial@dbotmaker.io