# xAI API (Grok) (slim)

> 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.

- Full: https://www.anchorterminal.com/tools/xai-api.md (~9,600 tokens) · this version ~1,680 tokens · JSON https://www.anchorterminal.com/tools/xai-api.json · canonical https://www.anchorterminal.com/tools/xai-api
- Index: https://www.anchorterminal.com/llms.txt · API: https://www.anchorterminal.com/api/v1/index.json · MCP: https://www.anchorterminal.com/mcp · Updated: 2026-11-07 · pricing https://www.anchorterminal.com/tools/xai-api#pricing · reviews https://www.anchorterminal.com/tools/xai-api#reviews
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)

**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

- Kind: Model API · vendor: SpaceXSI (xAI) · category: Model APIs & inference · legal entity: not named · provenance 73/100
- Endpoint: `https://api.x.ai/v1` (HTTP)
- Auth: API key · pricing: Pay per use · x402: no · licence: Proprietary service under xAI's enterprise terms of service. The Python SDK is Apache-2.0
- Benchmark probes: not run yet, so Performance is pending
- Live, from our pollers (not part of the score): up at 2026-11-07 18:21 UTC · uptime 30 days 100.0% (200 probes) · p50 178 ms · p95 276 ms over 24 hours
- Vendor status page: not read, no machine-readable status found (2026-11-07 04:49 UTC)
- 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
- Models ($/1M in/out): `grok-4.7` $2/$6; `grok-4.3` $1.25/$2.50
- Prices: 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
- 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
- 2026-10-02 Shutdown: `grok-voice-transcribe-1.0` end of life, routed to `grok-voice-transcribe-2.0` at the same price
- 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

- Scores: Reliability 55, Performance pending, Schema & documentation 88, Agent ergonomics 90, Security & auth 97, Payments & pricing 20, Task success pending, Maintenance & community 77, Transparency & trust 63 · total over the 7 assessed categories
- Why: Reliability, Status page at status.x.ai with components for the global and US API endpoints, voice, the consumer apps and, since the Cursor merger, Curso… · Schema & documentation, OpenAPI 3.1 document at docs.x.ai/openapi.json, 39 paths and 205 schemas on 6 November, covering Responses, Chat Completions, files, images… · Agent ergonomics, Model reading of the checklist (tool use, structured output, caching, context, batch, SDKs, errors). · Security & auth, Model reading. · Payments & pricing, No x402, MPP or L402 (0). · Maintenance & community, Model reading. · Transparency & trust, Closed service under xAI's enterprise terms, with the Python SDK under Apache-2.0 (15).
- Sources: 28, open questions: 6, both in the full twin
- Capabilities: inference.llm
- JSON: https://www.anchorterminal.com/api/v1/tools/xai-api.json
- Verify (for the vendor): the badge `https://www.anchorterminal.com/badges/xai-api.svg` or a link to https://www.anchorterminal.com/tools/xai-api 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, then `POST https://www.anchorterminal.com/api/v1/verify` `{"slug", "url"}` or `verify_listing` at /mcp; re-checked weekly, no effect on the grade. Snippets in the full twin.
- Support: Discord https://discord.gg/x-ai; support@x.ai; https://docs.x.ai/developers/debugging; https://docs.x.ai/developers/faq/security; more in the full twin

## Before you call it

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

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

```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

| Tool | Grade | Score | Shared capabilities | Slim |
| --- | --- | --- | --- | --- |
| Vertex AI (Gemini Enterprise Agent Platform) | AA | 88.7 | inference.llm | https://www.anchorterminal.com/tools/vertex-ai.min.md |
| OpenAI API | A | 83.9 | inference.llm | https://www.anchorterminal.com/tools/openai-api.min.md |
| Amazon Bedrock | A | 81.7 | inference.llm | https://www.anchorterminal.com/tools/amazon-bedrock.min.md |
| Azure OpenAI in Foundry Models | A | 80 | inference.llm | https://www.anchorterminal.com/tools/azure-openai.min.md |
| BlockRun.AI | A | 78.9 | inference.llm | https://www.anchorterminal.com/tools/blockrun-ai.min.md |


## Panel reviews (0, desk reviews from public material, no calls made)

