# xAI API (Grok)

> xAI's API for its Grok models (the docs now name the company SpaceXSI), with text, image, video and voice endpoints, server-side search and remote MCP tools, through an OpenAI-compatible REST API or gRPC.

- Canonical: https://www.anchorterminal.com/tools/xai-api
- Pricing: https://www.anchorterminal.com/tools/xai-api#pricing
- Reviews: https://www.anchorterminal.com/tools/xai-api#reviews
- Markdown: https://www.anchorterminal.com/tools/xai-api.md (~9,600 tokens)
- Slim: https://www.anchorterminal.com/tools/xai-api.min.md (~1,680 tokens, same facts, less prose, for token-sensitive contexts)
- JSON: https://www.anchorterminal.com/tools/xai-api.json (this page as data, same URL with Accept: application/json)
- Site index for agents: https://www.anchorterminal.com/llms.txt (the key docs and every listing in one file, at most 16 MB, about 4 million tokens: https://www.anchorterminal.com/llms-full.txt)
- API: https://www.anchorterminal.com/api/v1/index.json
- MCP: https://www.anchorterminal.com/mcp (the whole catalogue as tools, no key)
- DNS: dig +short TXT xai-api.grade.anchorterminal.com (the grade as a DNS TXT record, for a sandbox with no HTTP where names still resolve; also top., best.<category>. and <a>.vs.<b>. under the zone, and the same under grade.letme.dev)
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)
- Updated: 2026-11-07

## Overview

**Grade BB · 71.7/100 · rank #151 of 1486 · #8 in Model APIs & inference · agent-ready · confidence medium**


## Assessment

Grok 4.7 at $2/$6 per million tokens, now 20% off in batch, with a public OpenAPI spec, llms.txt, API keys limited by endpoint and model, and self-serve zero data retention. The API endpoints had a 3 hour 40 minute models outage on 3 September 2026, no SLA was found, and there's no free tier or first-party SDK beyond Python.

## Facts

| Field | Value |
| --- | --- |
| Vendor | SpaceXSI (xAI) (https://x.ai) |
| Kind | Model API |
| Category | Model APIs & inference (https://www.anchorterminal.com/categories/inference) |
| Transport | HTTP |
| Endpoint | `https://api.x.ai/v1` |
| Auth | API key · `Authorization: Bearer` with a team API key from console.x.ai. Keys can be limited to endpoints and models by ACL, capped by QPM and TPM, given an expiry, and rotated or disabled through the Management API. mTLS is documented as an option, and GitHub secret scanning disables leaked keys. |
| Pricing | Pay per use (from $1.25 / 1M in) · Prepaid credits, then the default payment method at month end. Grok 4.7 costs $2 input, $0.50 cached input and $6 output per 1M tokens below 200K prompt tokens, and $4/$1/$12 above, applied to the whole request. Batch is 20% off on grok-4.7, 4.6, 4.5, 4.3 and the grok-4.20 models. Priority processing 2x, the US regional endpoint 1.1x. Web search, code execution and attachment search $5 per 1,000 calls, collections search $2.50, X search $5 per 1,000 posts. $0.05 fee for a request blocked before generation for a usage-policy violation (https://docs.x.ai/developers/pricing, checked 2026-11-06). |
| x402 | No · No x402, MPP or L402 in the docs, llms.txt or the OpenAPI spec. Access needs a console account loaded with prepaid credits (checked 2026-11-06). |
| Licence | Proprietary service under xAI's enterprise terms of service. The Python SDK is Apache-2.0 |
| Packages | pypi: `xai-sdk` |
| Source | https://github.com/xai-org/xai-sdk-python |
| Docs | https://docs.x.ai |
| llms.txt | https://docs.x.ai/llms.txt |
| Last release | 2026-11-02 |
| GitHub stars | 597 (as of 2026-11-06) |
| PyPI downloads / week | 912,149 |
| Free tier | None found for the text API. The quickstart says to load the account with credits |
| Trains on API data | No, not without explicit permission |
| Data retention | Requests and responses kept 30 days for abuse auditing, then deleted. Stored responses kept 30 days |
| Zero data retention | Self-serve per team. Disables stateful Responses, Files, Collections, Batch and deferred completions |
| Data location | Global endpoint has no region guarantee. US endpoint keeps handling, inference, moderation and retained data in the US |
| Rate limits | Tiers by cumulative spend. grok-4.7 at Tier 0 is 150 requests a second and 50M TPM |
| MCP | Remote MCP tool in the Responses API, with `allowed_tools` and no approval step |
| Batch | 20% off on grok-4.7, grok-4.6, grok-4.5, grok-4.3 and the grok-4.20 models. Image and video in batch are billed at standard rates |
| Certifications | SOC 2 Type 2 per the security FAQ, reports in a trust centre behind an NDA |
| Moderation controls | A `guidelines` array on Chat Completions and Responses sets `decline` for nsfw, violence or profanity, added in October 2026 |
| Capabilities | inference.llm |
| Tags | official, hosted, model, prepaid, openapi, llms-txt, openai-compatible, closed-source, python, batch, status-page, bug-bounty, soc2 |
| JSON | https://www.anchorterminal.com/api/v1/tools/xai-api.json |

## Score breakdown (methodology v0.7, October 2026 research run)

Assessed 2026-11-06 from public evidence against the published checklist (https://www.anchorterminal.com/benchmark/#checklist). Confidence: medium. Performance and Task success pending (no score, not in the total); the total is Σ(score × weight) ÷ 80 over the 7 assessed categories. "This run" is each category's share of the 100 points.

| Category | Weight | This run | Score (0–100) | Points |
| --- | --- | --- | --- | --- |
| Reliability | 16% | 20 | 55 | 11.0 |
| Performance | 10% | pending | pending | n/a |
| Schema & documentation | 13% | 16.2 | 88 | 14.3 |
| Agent ergonomics | 13% | 16.2 | 90 | 14.6 |
| Security & auth | 14% | 17.5 | 97 | 17.0 |
| Payments & pricing | 10% | 12.5 | 20 | 2.5 |
| Task success | 10% | pending | pending | n/a |
| Maintenance & community | 7% | 8.8 | 77 | 6.7 |
| Transparency & trust (editorial 52, provenance 73) | 7% | 8.8 | 63 | 5.5 |
| Negative events | up to −15 | up to −15 | none recorded | 0 |
| **Total** | | | | **71.7 → BB** |

### Why each score

- Reliability 55 (checked 2026-11-06): Status page at status.x.ai with components for the global and US API endpoints, voice, the consumer apps and, since the Cursor merger, Cursor's services, with an RSS feed (20). The feed, read on 6 November, now holds 267 incidents back to 11 August, so the whole 90-day window is readable. On the API components there were high error rates on grok-4.6 and grok-4.5 from 21:57 to 23:28 UTC on 17 August (about 90 minutes) and a models outage on the global and US endpoints from 13:30 to 17:09 UTC on 3 September (about 3 hours 40 minutes), so several majors. A 26-minute datacenter outage across the API on 22 September, voice disruptions of 12 and 28 minutes on 10 September and 6 October, a 63-minute voice and Imagine degradation on 30 October and a 37-second model degradation on 24 October add to the record (0). Rate limits published per model and tier, grok-4.7 at Tier 0 is 150 requests a second and 50M TPM, with the per-second cap derived as RPM divided by 48 (15). The rate-limits page shows exponential backoff on 429, but no Retry-After header or overload guidance was found (10 of 15). No SLA found in the docs or llms.txt (0). The Responses API has been GA since September 2025 and grok-4.7 carries no preview label (10).
- Performance: Pending. Latency is measured per call by our probes, which haven't run yet, so this run doesn't score it. Its weight is shared across the assessed categories until the first probe window closes.
- Schema & documentation 88 (checked 2026-11-06): OpenAPI 3.1 document at docs.x.ai/openapi.json, 39 paths and 205 schemas on 6 November, covering Responses, Chat Completions, files, images, videos and models. The batch endpoints documented in the REST reference still aren't in it (20 of 25, applied as for gemini-api's missing Interactions API). llms.txt and a Markdown twin of every page, plus a docs MCP server (10). The models page says which model to use for code, chat, images, video and voice, and reference pages list each parameter. Reference not read in full (18 of 20). Structured outputs are guaranteed to match the schema for supported keywords, and tool arguments always conform with `strict` implicitly true (15). Examples in Python, JavaScript and curl on every guide. The debugging page lists status codes with fixes, but the cause cells for 400, 403, 404 and 415 are still empty (13 of 15). Release notes are grouped by month without day dates, and model slugs come as aliases and dated versions (12 of 15).
- Agent ergonomics 90 (checked 2026-11-06): Model reading of the checklist (tool use, structured output, caching, context, batch, SDKs, errors). Function calling with parallel calls on by default and `tool_choice` of auto, required, none or a named function (20). Guaranteed structured outputs (15). Automatic prompt caching, cached input at 0.25x on grok-4.7 ($0.50 per million) and 0.16x on grok-4.3 (15). 500,000-token context on grok-4.7 and 1,000,000 on grok-4.3, 13 of 15 for the default model's 500K. The Batch API is now 20% off on grok-4.7, 4.6 and 4.5 as well as the older models, with batch requests outside the rate limits (10 of 10, up from 5 on 6 October). One first-party SDK, `xai-sdk` for Python, with the OpenAI SDKs and Vercel's AI SDK documented as alternatives (5 of 10). Status codes documented with fixes, no Retry-After header found (12 of 15).
- Security & auth 97 (checked 2026-11-06): Model reading. Team API keys with ACLs per endpoint and per model, QPM and TPM caps, expiry, and create, rotate, disable and delete through the Management API, plus documented mTLS. GitHub secret scanning disables leaked keys and emails the owner (30). The security FAQ says SpaceXSI never trains on API inputs or outputs without explicit permission (20). Requests and responses are kept 30 days for abuse auditing, then deleted, and team admins can switch on zero data retention themselves, confirmed by an `x-zero-data-retention` header on every response (15). Console audit log and a Management API audit-events endpoint, plus optional per-key request logging (15). security.txt valid to 2027-06-29 with a HackerOne bug bounty and a separate safety contact for prompt-injection issues. SOC 2 Type 2 is claimed in the security FAQ with the reports behind an NDA in the trust centre, so 17 of 20. Remote MCP doesn't support `require_approval`, which the model checklist doesn't score but reviewers should see. New in October, a `guidelines` array lets the caller make the model decline nsfw, violence or profanity content, which the checklist doesn't score.
- Payments & pricing 20 (checked 2026-11-06): No x402, MPP or L402 (0). Per-token and per-call prices published without a login on docs.x.ai/developers/pricing (20). No free tier found for the text API, and the quickstart says to load the account with credits (0). Sign-up is in the browser at console.x.ai. The Management API can create keys and top up prepaid credit, but only with a management key made by a person in the console, so no line credit (0).
- Task success: Pending. Task success needs the category task suites run through each tool, which haven't run yet, so this run doesn't score it. Its weight is shared across the assessed categories until then. A data provider's data-quality score is published on its listing now and becomes half of this category when it's scored.
- Maintenance & community 77 (checked 2026-11-06): Model reading. grok-imagine-image-quality and grok-imagine-image-pro retired on 2 November 2026 as announced in September, Grok Voice 3.0 and custom moderation controls in October, Grok 4.7 on 21 September (30). No minimum notice period found. Retirements come as dated migration guides, retired slugs redirect to a replacement rather than failing, billed at the replacement's price, and grok-voice-2.0 was deprecated in October with no end date (4 of 12). Shutdowns in the last 90 days with dates given in advance, `grok-voice-transcribe-1.0` on 2 October and `grok-imagine-image-quality` on 2 November (8 of 8). Release notes several times a month but dated only by month, support by email and a Discord #help channel, not tested. On xai-sdk-python a collaborator commented on 2 of the 16 most recent threads with replies, and most outside pull requests since 23 October are open without a maintainer reply (10 of 15, down from 12). The repository has CI, release and version-bump workflows (5 of 10). One current first-party SDK, `xai-sdk` 1.21.0 tagged on 23 October, Python only (10 of 15). Supported runtimes stated, Python 3.10 or later (10).
- Transparency & trust 63 (checked 2026-11-06): Closed service under xAI's enterprise terms, with the Python SDK under Apache-2.0 (15). The docs agree with each other on no training, 30-day abuse retention, 30-day storage of stateful responses and the ZDR route, but the privacy policy, enterprise terms and DPA at x.ai/legal answered a Cloudflare block page on 6 October and again on 6 November, so they couldn't be compared (15 of 30). Dated migration guides and redirect tables for each retirement, but no written deprecation policy, and Chat Completions, Anthropic compatibility and grok-voice-2.0 are labelled deprecated with no date (12 of 20). The US regional endpoint states what stays in the US, the global endpoint guarantees no region, and no subprocessor list was readable (10 of 20).

Fix list, everything this grade says the listing lacks, the biggest gain first (18 items). What it covers is at https://www.anchorterminal.com/fixes/xai-api.md (JSON https://www.anchorterminal.com/fixes/xai-api.json). The whole list for a coding agent comes from `POST https://www.anchorterminal.com/api/v1/fix-list` with `{"listing": "xai-api", "plan": "read"}`, free while the beta runs

### What we couldn't check

- unchecked: the enterprise terms, privacy policy, DPA and subprocessor list at x.ai/legal, which answered a Cloudflare block page (403) on 6 October and 6 November 2026, so the contracting entity and the legal retention terms weren't compared with the docs. Every other x.ai page robots.txt allows (home, news, company) answered the same block on 6 November
- The docs now name the company SpaceXSI and the status page SpaceXAI. We didn't find a readable first-party statement of the legal change (x.ai is blocked and spacex.com/updates is drawn by script), so the listing keeps the xAI name
- unchecked: SOC 2 Type 2 reports and other certifications, which sit in the trust centre behind an NDA; trust.x.ai is a script-drawn Vanta page
- Whether 429 responses carry a Retry-After header. The rate-limits and debugging pages don't mention one
- When Chat Completions, the Anthropic-compatible endpoint and grok-voice-2.0 will be shut down. All three are labelled deprecated with no date
- On 6 November we fetched pypi.org/pypi/xai-sdk/json before checking pypi.org/robots.txt, which disallows /pypi/*/json. Nothing from it is used; versions come from the repository's tags and downloads from pypistats

### Sources

- status feed: <https://status.x.ai/feed.xml> (seen 2026-11-06)
- llms.txt: <https://docs.x.ai/llms.txt> (seen 2026-11-06)
- llms-full.txt: <https://docs.x.ai/llms-full.txt> (seen 2026-10-06)
- OpenAPI document: <https://docs.x.ai/openapi.json> (seen 2026-11-06)
- API catalogue: <https://docs.x.ai/.well-known/api-catalog> (seen 2026-10-06)
- models: <https://docs.x.ai/developers/models.md> (seen 2026-11-06)
- pricing: <https://docs.x.ai/developers/pricing.md> (seen 2026-11-06)
- release notes: <https://docs.x.ai/developers/release-notes.md> (seen 2026-11-06)
- rate limits: <https://docs.x.ai/developers/rate-limits.md> (seen 2026-11-06)
- debugging errors: <https://docs.x.ai/developers/debugging.md> (seen 2026-11-06)
- security FAQ (training, retention, ZDR, SOC 2, audit logs, keys): <https://docs.x.ai/developers/faq/security.md> (seen 2026-11-06)
- regional endpoints: <https://docs.x.ai/developers/advanced-api-usage/regions.md> (seen 2026-10-06)
- Management API, API keys and ACLs: <https://docs.x.ai/developers/rest-api-reference/management/auth.md> (seen 2026-10-06)
- Management API, audit logs: <https://docs.x.ai/developers/rest-api-reference/management/audit.md> (seen 2026-10-06)
- May 15 retirement guide: <https://docs.x.ai/developers/migration/may-15-retirement.md> (seen 2026-10-06)
- Responses and Chat Completions comparison: <https://docs.x.ai/developers/model-capabilities/text/comparison> (seen 2026-11-06)
- remote MCP tools: <https://docs.x.ai/developers/tools/remote-mcp.md> (seen 2026-11-06)
- structured outputs: <https://docs.x.ai/developers/model-capabilities/text/structured-outputs.md> (seen 2026-10-06)
- function calling: <https://docs.x.ai/developers/tools/function-calling.md> (seen 2026-10-06)
- Grok 4.7 announcement: <https://x.ai/news/grok-4-7> (seen 2026-10-06)
- security.txt: <https://x.ai/.well-known/security.txt> (seen 2026-11-06)
- xai-sdk-python repository: <https://github.com/xai-org/xai-sdk-python> (seen 2026-11-06)
- x.ai registration (RDAP): <https://rdap.identitydigital.services/rdap/domain/x.ai> (seen 2026-10-06)
- custom moderation controls: <https://docs.x.ai/developers/advanced-api-usage/custom-moderation-controls.md> (seen 2026-11-06)
- legacy and deprecated endpoints: <https://docs.x.ai/developers/rest-api-reference/inference/legacy.md> (seen 2026-11-06)
- xai-sdk downloads: <https://pypistats.org/api/packages/xai-sdk/recent> (seen 2026-11-06)
- xai-sdk-python issues and pull requests: <https://api.github.com/repos/xai-org/xai-sdk-python/issues> (seen 2026-11-06)
- x.ai robots.txt: <https://x.ai/robots.txt> (seen 2026-11-06)

## Score history

Every move of a score since the listing was graded, newest first, with its cause. A score can't move without an entry here. JSON: https://www.anchorterminal.com/api/v1/tools/xai-api/history.json

- 2026-11-06: graded 71.7 BB (methodology 0.7)

## Who's behind it (provenance 73/100, checked 2026-11-06)

| Check | Finding | Points |
| --- | --- | --- |
| Legal entity named | not found | 0/20 |
| Domain age | x.ai, registered 2017-12-16 (8 years) | 11/15 |
| Endpoint on the vendor's domain | api.x.ai | 15/15 |
| Terms of service | read, states 5 of the 7 things a reader expects | 8.3/10 |
| Privacy policy | read, states 7 of the 8 things a reader expects, and has 1 clause that costs points | 7.3/10 |
| Status page | status.x.ai | 10/10 |
| Changelog | published | 10/10 |
| security.txt | valid | 10/10 |
| People named | 1 named with their role, none with a public profile | 7/10 |
| Support route | a support address, help pages, a community | 5/5 |

x.ai was registered in 2017, before the company, and transferred on 2026-06-02 per RDAP. Every x.ai page except robots.txt and security.txt answered a Cloudflare block page (403) on 2026-11-06, as the legal pages did on 2026-10-06, so the contracting entity wasn't confirmed. The docs now use the name SpaceXSI and the status page SpaceXAI.

x.ai/robots.txt allows all but /tools/, with Content-Signal ai-train=yes, search=yes, ai-input=yes. docs.x.ai allows all with ai-input=yes. The x.ai pages that robots.txt allows answered a Cloudflare 'Attention Required' page, which we did not try to get past.

security.txt at x.ai/.well-known/security.txt is valid to 2027-06-29, with vulnerabilities@x.ai and abuse@x.ai.

### Terms and privacy, as read

A reading by a fixed set of rules, each answered with the vendor's own sentence. Not legal advice.

**Terms of service** (https://x.ai/legal/terms-of-service-enterprise), read 2026-11-06, dated 2026-10-27, states 5 of the 7 things a reader expects.

- To know. Requires arbitration or waives class actions. "EACH PARTY ACKNOWLEDGES AND AGREES THAT, TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IT HEREBY IRREVOCABLY WAIVES (A) ANY RIGHT IT MAY HAVE TO A TRIAL BY JURY IN ANY ACTION, PROCEEDING, OR CLAIM ARISING OUT OF OR RELATING TO THIS AGREEMENT OR THE SERVICES;"
- Gives the date it was last updated. Last updated 2026-10-27.
- Names the governing law or courts. The law of the State of Texas.
- States a limit on its liability. Capped at the fees paid in the 12 months before the claim.
- Not found in the text. Says how changes to the terms are announced.
- Not found in the text. Refers to a service level or uptime commitment.

**Privacy policy** (https://x.ai/legal/privacy-policy), read 2026-11-06, dated 2026-10-27, states 7 of the 8 things a reader expects.

- To know. Says it may use customer content to train or improve models, and no opt-out was found (costs points). "Publicly Available Data: We use information that is publicly available on the internet to train our models and provide resulting Output."
- Gives the date it was last updated. Last updated 2026-10-27.
- Says how long data is kept. Names a period of 30 days.
- Gives a privacy contact. privacy@x.ai.
- Not found in the text. Says where data is transferred or stored.

## Humans behind the project (researched 2026-11-06 from public pages, not part of the grade)

### Key people

- Elon Musk, Founder, xAI (now SpaceXAI LLC, a SpaceX subsidiary)
- Note: Company facts, founder, ownership and investors are copied from the Grok Bot listing's file (data/humans/grok-bot.json, checked 29 October 2026), the site's other SpaceXSI listing. On 6 November 2026 every x.ai page robots.txt allows, including the company and news pages, answered a Cloudflare block page (403), and spacex.com/updates is drawn by script, so no team page or first-party acquisition notice could be read. docs.x.ai names no API team. One search on 6 November found press reports of SpaceX's acquisition of xAI announced on 2 February 2026, matching the date already recorded; nothing new was added from them. On 6 November 2026 the Daily Star's report of the deal (citing Reuters) was read again: "The transaction values SpaceX at $1 trillion, and xAI at $250 billion, according to a person familiar with the matter", and Wikipedia's SpaceXAI article gives the same figures, so the $250B price SpaceX paid is recorded as the valuation. Wikipedia also says SpaceX listed its shares in June 2026; xAI's status is kept as acquired, as in the Cursor listings' file for the same parent. No valuation is recorded: the $250B figure for the SpaceX deal comes from a person familiar with the matter as reported, not from either company (6 November 2026).
- SpaceXSI (SpaceXAI LLC): LinkedIn https://www.linkedin.com/company/spacexsi X https://x.com/spacexsi

### Ownership and investors

- Ownership: Acquired by SpaceX, 2 February 2026
- Backed by: Andreessen Horowitz, Sequoia Capital, Lightspeed Venture Partners, Tribe Capital, BlackRock, Fidelity Management & Research Company, Kingdom Holdings, MGX, Morgan Stanley, OIA, Qatar Investment Authority, Valor Equity Partners, Vy Capital, NVIDIA, AMD

### Getting support

- Discord: https://discord.gg/x-ai
- Support email: support@x.ai
- Help: https://docs.x.ai/developers/debugging
- Help: https://docs.x.ai/developers/faq/security
- Sources: https://docs.x.ai/developers/debugging.md, https://docs.x.ai/developers/faq/security.md, https://x.ai/.well-known/security.txt, https://en.wikipedia.org/wiki/XAI_(company)

## Live (updated 2026-11-07 18:21 UTC)

- Right now: up, HTTP 404, 122 ms, checked 2026-11-07 18:21 UTC (get on `https://api.x.ai/v1`)
- Uptime 24h 100.0% (200 probes) · 30 days 100.0% (200 probes) · p50 178 ms · p95 276 ms
- Vendor status page: not read, no machine-readable status found
- github `xai-org/xai-sdk-python` v1.21.0, released 2026-10-23
- pypi `xai-sdk` 1.21.0, released 2026-10-23
- security.txt: valid, expires 2027-06-29T00:00:00.000Z
- Watching deprecations <https://docs.x.ai/developers/migration/imagine-image-quality-nov-2>
- Watching deprecations <https://docs.x.ai/developers/migration/may-15-retirement>
- Watching deprecations <https://docs.x.ai/developers/release-notes>
- Watching pricing <https://docs.x.ai/developers/pricing>
- Watching privacy <https://x.ai/legal/privacy-policy>
- Watching terms <https://x.ai/legal/terms-of-service-enterprise>
- Always current: https://www.anchorterminal.com/api/v1/live/xai-api.json

## Probe metrics

Not measured yet. Our benchmark probes haven't run, so there's no availability, latency or error rate from a run and Performance is pending. Live uptime, where we poll the endpoint, is under Live and doesn't change the score.

## Models and prices (per 1M tokens)

| Model | Input | Output | Context | Role | Supports |
| --- | --- | --- | --- | --- | --- |
| `grok-4.7` Grok 4.7 | $2 | $6 | 500k | default (No text output limit. $4/$12 when the prompt reaches 200K tokens. Batch 20% off) | not checked |
| `grok-4.3` Grok 4.3 | $1.25 | $2.50 | 1M | mid ($2.50/$5 when the prompt reaches 200K tokens. Batch 20% off) | not checked |
 Rate limits depend on your account tier: https://docs.x.ai/developers/rate-limits

## What a task costs (estimated, per task)

| Model | Research report | Small website | Bug fix |
| --- | --- | --- | --- |
| `grok-4.7` (no cache price published, cached reads at the input price) | $21.76 | $4.85 | $1.07 |
| `grok-4.3` (no cache price published, cached reads at the input price) | $13.54 | $2.98 | $0.67 |

Each figure is the same tokens priced at this model's rates, research report (134 fresh input, 207k cache writes, 10.5M cache reads and 46k output, the median of 156 runs), small website (48 fresh input, 106k cache writes, 2.2M cache reads and 40k output, the median of 4 runs) and bug fix (16 fresh input, 57k cache writes, 472k cache reads and 2k output, the median of 4 runs). We measured the tokens with Claude Opus 5.5 in Claude Code, so another model may use more or fewer tokens for the same job, and these compare prices, not how well or how efficiently each model works. Long-context surcharges, batch discounts and free allowances aren't counted. How we measured them: https://www.anchorterminal.com/prices/index.md

## Prices

| Item | Price | Unit | Note |
| --- | --- | --- | --- |
| Web search tool | $5 | per 1,000 requests |  |
| Code execution tool | $5 | per 1,000 requests |  |
| Collections search tool | $2.50 | per 1,000 requests |  |

Across all listings: https://www.anchorterminal.com/prices/index.md

## Dated changes

- 2026-05-15 · Shutdown · `grok-4-1-fast`, `grok-4-fast`, `grok-4-0709`, `grok-code-fast-1` and `grok-3` retired, redirected to grok-4.3 or grok-build-0.1 at their prices (source: <https://docs.x.ai/developers/migration/may-15-retirement>)
- 2026-10-02 · Shutdown · `grok-voice-transcribe-1.0` end of life, routed to `grok-voice-transcribe-2.0` at the same price (source: <https://docs.x.ai/developers/release-notes>)
- 2026-11-02 · Shutdown · `grok-imagine-image-quality` and `grok-imagine-image-pro` retired, served by `grok-imagine-image-2.0` at `low` quality and a lower price (source: <https://docs.x.ai/developers/migration/imagine-image-quality-nov-2>)

All listings, as a calendar: https://www.anchorterminal.com/sunsets.ics

## Strengths

- Grok 4.7 at $2/$6 per million tokens below 200K prompt tokens, with a 500K context and 20% off through the Batch API
- API keys restricted by endpoint and model ACLs, with QPM and TPM caps, expiry and a rotate endpoint
- Self-serve team-wide zero data retention, confirmed on every response by an `x-zero-data-retention` header
- OpenAPI 3.1 spec, llms.txt and a Markdown twin of every docs page
- security.txt valid to 2027-06-29 and a HackerOne bug bounty

## Weaknesses

- API models outage of about 3 hours 40 minutes on 3 September 2026, and high error rates on grok-4.6 and grok-4.5 on 17 August
- No SLA, no free tier for the text API, and no Retry-After header documented for 429s
- No stated minimum notice for retirements, and retired slugs are served by a different model at its price
- Remote MCP doesn't support `require_approval`, so server-side tool calls run without an approval step
- The terms, privacy policy and DPA at x.ai/legal answered a Cloudflare block on 6 October and 6 November 2026, so they weren't read



## Before you call it (notes for agents)

1. Build on the Responses API at https://api.x.ai/v1. Chat Completions is labelled deprecated and the Anthropic-compatible endpoint fully deprecated
2. Pin a dated model slug. A retired slug keeps answering from a replacement model, billed at the replacement's price
3. Back off exponentially on 429. The per-second cap is the per-minute budget divided by 48, with a minimum of 2
4. Set `allowed_tools` on remote MCP servers. There's no approval step, and every exposed tool enters the context
5. Use https://us.api.x.ai/v1 when processing must stay in the US. It costs 1.1x and serves only grok-4.7 and grok-4.6

## Connect

Install:

```bash
pip install xai-sdk   # or: pip install openai, with base_url https://api.x.ai/v1
```

First request:

```bash
curl https://api.x.ai/v1/responses \
  -H "Authorization: Bearer $XAI_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"grok-4.7","input":"What is the meaning of life?"}'
```

## Similar tools

Ranked by shared capabilities, then score. Same-category tools with no shared capability key are listed last.

| Tool | Grade | Score | Rank | Shared capabilities | x402 | Markdown |
| --- | --- | --- | --- | --- | --- | --- |
| Vertex AI (Gemini Enterprise Agent Platform) | AA | 88.7 | 2 | inference.llm | no | https://www.anchorterminal.com/tools/vertex-ai.md |
| OpenAI API | A | 83.9 | 6 | inference.llm | no | https://www.anchorterminal.com/tools/openai-api.md |
| Amazon Bedrock | A | 81.7 | 8 | inference.llm | no | https://www.anchorterminal.com/tools/amazon-bedrock.md |
| Azure OpenAI in Foundry Models | A | 80 | 14 | inference.llm | no | https://www.anchorterminal.com/tools/azure-openai.md |
| BlockRun.AI | A | 78.9 | 20 | inference.llm | yes | https://www.anchorterminal.com/tools/blockrun-ai.md |
| Claude API | BB | 77.3 | 34 | inference.llm | no | https://www.anchorterminal.com/tools/anthropic-api.md |

## Panel reviews (0)

Reviewed by the Anchor panel (https://www.anchorterminal.com/reviewers/index.md): .

Desk reviews, written from public documentation, pricing, terms, source and status history on 1 October 2026. No calls made. For a desk review, the outcome says whether the reviewer's questions could be answered from public material: success, partial or failure. How reviews work: https://www.anchorterminal.com/reviews/how-it-works.md

## Notable

- Grok 4.7 was released on 21 September 2026 with a 500K context, no text output limit and reasoning effort from low to xhigh, and always returns encrypted reasoning on the Responses API (source: <https://docs.x.ai/developers/release-notes>)
- October 2026 release notes add Grok Voice 3.0 (grok-voice-latest now points to it), deprecate grok-voice-2.0 with no end date, and add a `guidelines` array that sets the model to decline nsfw, violence or profanity content (source: <https://docs.x.ai/developers/release-notes>)
- The Responses API is the recommended surface. Chat Completions is labelled deprecated and the Anthropic SDK compatibility fully deprecated, both without a shutdown date (source: <https://docs.x.ai/developers/model-capabilities/text/comparison>)
- Retired model slugs redirect to a replacement and are billed at its price. grok-imagine-image-quality and grok-imagine-image-pro have been served by grok-imagine-image-2.0 at low quality since 2 November 2026 (source: <https://docs.x.ai/developers/migration/imagine-image-quality-nov-2>)
- Zero data retention is self-serve for team admins and turns off stateful Responses, Files, Collections, Batch and deferred completions (source: <https://docs.x.ai/developers/faq/security>)
- Remote MCP tools don't support `require_approval`, and every tool a server exposes enters the context unless `allowed_tools` is set (source: <https://docs.x.ai/developers/tools/remote-mcp>)
- status.x.ai, titled SpaceXAI System Status, now also carries Cursor's components (Cloud Agents, Cursor IDE, Bugbot, Automations) beside the API endpoints (source: <https://status.x.ai/feed.xml>)
- xai-sdk 1.21.0 was tagged on 23 October 2026 (https://github.com/xai-org/xai-sdk-python), and pypistats counts 912,149 downloads in the week to 5 November (source: <https://pypistats.org/api/packages/xai-sdk/recent>)

- #8 of 42 in Best model APIs and inference for AI agents: https://www.anchorterminal.com/best/inference/index.md
- All 830 models comparisons: https://www.anchorterminal.com/compare/inference/index.md

## Compare

- [Amazon Bedrock vs xAI API (Grok)](https://www.anchorterminal.com/compare/amazon-bedrock-vs-xai-api.md): A 81.7 vs BB 71.7
- [Claude API vs xAI API (Grok)](https://www.anchorterminal.com/compare/anthropic-api-vs-xai-api.md): BB 77.3 vs BB 71.7
- [Antseed vs xAI API (Grok)](https://www.anchorterminal.com/compare/antseed-vs-xai-api.md): C 54.1 vs BB 71.7
- [Azure OpenAI in Foundry Models vs xAI API (Grok)](https://www.anchorterminal.com/compare/azure-openai-vs-xai-api.md): A 80 vs BB 71.7
- [BlockRun.AI vs xAI API (Grok)](https://www.anchorterminal.com/compare/blockrun-ai-vs-xai-api.md): A 78.9 vs BB 71.7
- [Cerebras Inference vs xAI API (Grok)](https://www.anchorterminal.com/compare/cerebras-inference-vs-xai-api.md): B 68.6 vs BB 71.7
- [Cloudflare AI Gateway vs xAI API (Grok)](https://www.anchorterminal.com/compare/cloudflare-ai-gateway-vs-xai-api.md): B 67.8 vs BB 71.7
- [Cloudflare Workers AI vs xAI API (Grok)](https://www.anchorterminal.com/compare/cloudflare-workers-ai-vs-xai-api.md): B 69.2 vs BB 71.7
- [Cohere Chat API (Command models) vs xAI API (Grok)](https://www.anchorterminal.com/compare/cohere-chat-vs-xai-api.md): B 65.6 vs BB 71.7
- [DeepInfra vs xAI API (Grok)](https://www.anchorterminal.com/compare/deepinfra-vs-xai-api.md): B 63.7 vs BB 71.7
- [DeepSeek API vs xAI API (Grok)](https://www.anchorterminal.com/compare/deepseek-api-vs-xai-api.md): D 46.7 vs BB 71.7
- [Eden AI vs xAI API (Grok)](https://www.anchorterminal.com/compare/eden-ai-vs-xai-api.md): C 59.9 vs BB 71.7
- [Glimpse vs xAI API (Grok)](https://www.anchorterminal.com/compare/elorian-glimpse-vs-xai-api.md): F 35.1 vs BB 71.7
- [Fireworks AI Inference vs xAI API (Grok)](https://www.anchorterminal.com/compare/fireworks-inference-vs-xai-api.md): B 69.3 vs BB 71.7
- [Gemini Developer API vs xAI API (Grok)](https://www.anchorterminal.com/compare/gemini-api-vs-xai-api.md): B 62.2 vs BB 71.7
- [GroqCloud vs xAI API (Grok)](https://www.anchorterminal.com/compare/groq-vs-xai-api.md): BB 74.5 vs BB 71.7
- [Hugging Face Inference Providers vs xAI API (Grok)](https://www.anchorterminal.com/compare/hugging-face-inference-providers-vs-xai-api.md): C 54 vs BB 71.7
- [Inkling 2 Small vs xAI API (Grok)](https://www.anchorterminal.com/compare/inkling-2-small-vs-xai-api.md): D 52.1 vs BB 71.7
- [Jais 3 vs xAI API (Grok)](https://www.anchorterminal.com/compare/jais-3-vs-xai-api.md): D 52.1 vs BB 71.7
- [Meta Model API vs xAI API (Grok)](https://www.anchorterminal.com/compare/meta-model-api-vs-xai-api.md): D 52.3 vs BB 71.7
- [MiniMax API vs xAI API (Grok)](https://www.anchorterminal.com/compare/minimax-api-vs-xai-api.md): C 55.3 vs BB 71.7
- [Mistral AI API vs xAI API (Grok)](https://www.anchorterminal.com/compare/mistral-api-vs-xai-api.md): B 65.7 vs BB 71.7
- [Muse Spark Open vs xAI API (Grok)](https://www.anchorterminal.com/compare/muse-spark-open-vs-xai-api.md): D 53.4 vs BB 71.7
- [Nemotron 3.5 Super VL vs xAI API (Grok)](https://www.anchorterminal.com/compare/nemotron-3-5-super-vl-vs-xai-api.md): C 59.3 vs BB 71.7
- [Novita AI vs xAI API (Grok)](https://www.anchorterminal.com/compare/novita-ai-vs-xai-api.md): D 53.9 vs BB 71.7
- [OpenAI API vs xAI API (Grok)](https://www.anchorterminal.com/compare/openai-api-vs-xai-api.md): A 83.9 vs BB 71.7
- [OpenRouter vs xAI API (Grok)](https://www.anchorterminal.com/compare/openrouter-vs-xai-api.md): B 66.6 vs BB 71.7
- [Prism Inference vs xAI API (Grok)](https://www.anchorterminal.com/compare/prism-inference-vs-xai-api.md): C 59.6 vs BB 71.7
- [Router.com (Ramp Router) vs xAI API (Grok)](https://www.anchorterminal.com/compare/ramp-router-vs-xai-api.md): D 53.7 vs BB 71.7
- [Beam 1.0 vs xAI API (Grok)](https://www.anchorterminal.com/compare/reflection-beam-vs-xai-api.md): D 53.4 vs BB 71.7
- [RouterPlus vs xAI API (Grok)](https://www.anchorterminal.com/compare/routerplus-vs-xai-api.md): D 50.3 vs BB 71.7
- [SambaCloud vs xAI API (Grok)](https://www.anchorterminal.com/compare/sambanova-vs-xai-api.md): B 64.9 vs BB 71.7
- [SiliconFlow vs xAI API (Grok)](https://www.anchorterminal.com/compare/siliconflow-vs-xai-api.md): E 42.9 vs BB 71.7
- [Simplismart vs xAI API (Grok)](https://www.anchorterminal.com/compare/simplismart-vs-xai-api.md): F 29.5 vs BB 71.7
- [StepFun API vs xAI API (Grok)](https://www.anchorterminal.com/compare/stepfun-api-vs-xai-api.md): E 44.3 vs BB 71.7
- [SWE-2 Flash vs xAI API (Grok)](https://www.anchorterminal.com/compare/swe-2-flash-vs-xai-api.md): F 36.4 vs BB 71.7
- [Tencent Cloud TokenHub vs xAI API (Grok)](https://www.anchorterminal.com/compare/tencent-tokenhub-vs-xai-api.md): C 59.5 vs BB 71.7
- [Together AI Inference vs xAI API (Grok)](https://www.anchorterminal.com/compare/together-inference-vs-xai-api.md): B 67.8 vs BB 71.7
- [Vercel AI Gateway vs xAI API (Grok)](https://www.anchorterminal.com/compare/vercel-ai-gateway-vs-xai-api.md): B 67.8 vs BB 71.7
- [Vertex AI (Gemini Enterprise Agent Platform) vs xAI API (Grok)](https://www.anchorterminal.com/compare/vertex-ai-vs-xai-api.md): AA 88.7 vs BB 71.7

## Verify this listing

For the vendor. The badge or a plain link to this page verifies the listing, from a page on x.ai or one of its subdomains, or the README at the root of github.com/xai-org/xai-sdk-python. It shows the listing is the vendor's and that the vendor knows it's here, and it never changes a grade, rank or review. The vendor sends the page's address to `POST https://www.anchorterminal.com/api/v1/verify` as `{"slug": "xai-api", "url": "…"}`, or calls the `verify_listing` tool at https://www.anchorterminal.com/mcp. We fetch the page once, then again every week; two failed checks in a row and the verification lapses, and a later pass restores it. What we check: https://www.anchorterminal.com/builders/index.md#verify

HTML badge:

```html
<a href="https://www.anchorterminal.com/tools/xai-api"><img src="https://www.anchorterminal.com/badges/xai-api.svg" alt="xAI API (Grok) on Anchor Terminal" height="20"></a>
```

Markdown badge, for a README:

```markdown
[![xAI API (Grok) on Anchor Terminal](https://www.anchorterminal.com/badges/xai-api.svg)](https://www.anchorterminal.com/tools/xai-api)
```

Plain link:

```html
<a href="https://www.anchorterminal.com/tools/xai-api">xAI API (Grok) on Anchor Terminal</a>
```

## Share this listing

For the vendor. Sharing assets for social media, two PNGs of 1200 × 630 that say xAI API (Grok) is listed on Anchor Terminal, with the vendor's logo and this page's address and no grade or score.

- Dark: https://www.anchorterminal.com/assets/share/xai-api-dark.png
- Light: https://www.anchorterminal.com/assets/share/xai-api-light.png

---

Query this catalogue directly over MCP: https://www.anchorterminal.com/mcp (Streamable HTTP, no key). How: https://www.anchorterminal.com/agents/#mcp
