Skip to content
GridRouterhome

Search

Search providers, capabilities and pages

xAI API API

x.ai

AI UtilitiesListed, not routed yet
Grok model API with spend-based rate-limit tiers.

What it does

xAI API at https://api.x.ai/v1 for Grok language, image, video, voice and embedding models; batch, prompt caching and remote MCP tools. Rate-limit tiers by cumulative spend since 2026-01-01 (Tier 0 $0, Tier 1 $50, Tier 2 $250, Tier 3 $1,000, Tier 4 $5,000); hard RPS and TPM caps per model; 429 when exceeded.

Pricing

What xAI API publishes for buying direct, as listed on its own pages.

Buying direct from xAI API

  • Grok (500k context)$2.00 / 1M input tokens

Larger plans through sales. xAI API pricing, checked Sep 29, 2026

Docs

xAI API's own pages, linked as published.

Its OpenAPI document: 43 operations and rate limits
Official specOpenAPI 3.1.0 · 43 operations Spec (YAML)Provider's spec
Operations in the xai spec
MethodPathSummaryParamsSource
GET/v1/api-keyGet information about an API key, including name, status, permissions and users who created or modified this key.0Spec
POST/v1/chat/completionsCreate a chat response from text/image chat prompts. This is the endpoint for making requests to chat and image understanding models.0Spec
GET/v1/chat/deferred-completion/{request_id}Tries to fetch a result for a previously-started deferred completion. Returns `200 Success` with the response body, if the request has been 1Spec
POST/v1/complete(Legacy - Not supported by reasoning models) Create a text completion response. This endpoint is compatible with the Anthropic API.0Spec
POST/v1/completions(Legacy - Not supported by reasoning models) Create a text completion response for a given prompt. Replaced by /v1/chat/completions.0Spec
POST/v1/documents/searchSearch for content related to the query within the given collections.0Spec
GET/v1/embedding-modelsList all embedding models available to the authenticating API key with full information. Additional information compared to /v1/models inclu0Spec
GET/v1/embedding-models/{model_id}Get full information about an embedding model with its model_id.1Spec
POST/v1/embeddingsCreate an embedding vector representation corresponding to the input text. This is the endpoint for making requests to embedding models.0Spec
GET/v1/filesList files owned by the authenticated team, paginated. The response always returns a `pagination_token`; pass it back as a query parameter t6Spec
POST/v1/filesUpload a file to xAI's storage. Returns the file's metadata. Files can be referenced by ID anywhere a `file_id` is accepted (e.g. chat attac0Spec
GET/v1/files/{file_id}Retrieve metadata for a single file by ID. Errors with 404 if the file doesn't exist, has been deleted, or has passed its `expires_at`.1Spec
DELETE/v1/files/{file_id}Delete a file by ID. After this returns, the file no longer appears in `GET /v1/files`, content download returns 404, and the ID can no long1Spec
GET/v1/files/{file_id}/contentDownload the contents of a file as a stream of raw bytes. The response `Content-Type` is `application/octet-stream`. Use this for the binary2Spec
POST/v1/files/{file_id}/public-urlCreate a permanent, unauthenticated public URL for an existing file. The underlying file is unaffected and can still be fetched through the 1Spec
POST/v1/files/{file_id}/public-url/revokeRevoke the active public URL for a file. The underlying file remains available through the authenticated content endpoint. Revoke is idempot1Spec
GET/v1/image-generation-modelsList all image generation models available to the authenticating API key with full information. Additional information compared to /v1/model0Spec
GET/v1/image-generation-models/{model_id}Get full information about an image generation model with its model_id.1Spec
POST/v1/images/editsEdit an image based on a prompt. This is the endpoint for making edit requests to image generation models.0Spec
POST/v1/images/generationsGenerate an image based on a prompt. This is the endpoint for making generation requests to image generation models.0Spec
GET/v1/language-modelsList all chat and image understanding models available to the authenticating API key with full information. Additional information compared 0Spec
GET/v1/language-models/{model_id}Get full information about a chat or image understanding model with its model_id.1Spec
GET/v1/meGet information about the currently authenticated caller. Works with both API keys and OAuth tokens. Returns identity, team, and ZDR status.0Spec
POST/v1/messagesCreate a messages response. This endpoint is compatible with the Anthropic API.0Spec
GET/v1/modelsList all models available to the authenticating API key, including model names (ID), creation times, and pricing.0Spec
GET/v1/models/{model_id}Get information about a model with its model_id, including pricing.1Spec
POST/v1/responsesGenerates a response based on text or image prompts. The response ID can be used to retrieve the response later or to continue the conversat0Spec
POST/v1/responses/compactCompacts a full Responses API input window into a shorter canonical window.0Spec
GET/v1/responses/{response_id}Retrieve a previously generated response.1Spec
DELETE/v1/responses/{response_id}Delete a previously generated response.1Spec
GET/v1/responses/{response_id}/input_itemsList input items for a previously generated response.4Spec
GET/v1/skillshandle_list_skills_request3Spec
POST/v1/skillshandle_upload_skill_request0Spec
GET/v1/skills/{skill_id}handle_retrieve_skill_request1Spec
DELETE/v1/skills/{skill_id}handle_delete_skill_request1Spec
GET/v1/skills/{skill_id}/contenthandle_download_skill_content_request1Spec
POST/v1/tokenize-textTokenize text with the specified model0Spec
GET/v1/video-generation-modelsList all video generation models available to the authenticating API key with full information.0Spec
GET/v1/video-generation-models/{model_id}Get full information about a video generation model with its model_id.1Spec
POST/v1/videos/editsEdit a video based on a prompt. This is an asynchronous operation that returns a request_id for polling.0Spec

Showing 40 of 43 operations; the full list is in the spec.

Rate limits

Published rate limits for xai
LimitScopePlanEndpointBurst / concurrency
37 / secondplanTier 0grok-4.20-0309-reasoning— / —
50 / secondplanTier 1grok-4.20-0309-reasoning— / —
75 / secondplanTier 2grok-4.20-0309-reasoning— / —
125 / secondplanTier 3grok-4.20-0309-reasoning— / —
208 / secondplanTier 4grok-4.20-0309-reasoning— / —

On 429: Exceeding any RPS or TPM limit returns 429 Too Many Requests. GridRouter never paces above these and backs off on 429, honoring Retry-After. Source, checked Sep 29, 2026

Sources for this page (2)