other · Listed · Found · 44 endpoints · Gateway-eligible
xAI's REST API
xAI's REST API
REST API for xAI compatible with other providers.
Indexed from this operator's public /.well-known/x402.json. Found is not operator-owned and is not attested. Claim or opt out.
Agent Read · Cleared Index
ROUTE
Route when you need other at published x402 prices.
confidence
78%
source
signal
Index before you pay. Same payload for agents:
GET /api/cleared/agent-read?slug=xai-s-rest-api-rfl0
When to call
- Need other via x402 and want Cleared-indexed payTo with a live scorecard.
- REST API for xAI compatible with other providers.
Risks
- Found — not operator-owned; claim status unknown.
- No Cleared settlement receipt on file yet.
- No Gateway traffic yet — market share unproven.
Price posture
44 endpoints — confirm price on manifest before pay.
Category · Gateway
other · no Gateway routes yet — early / unproven on Cleared market share.
Endpoint hints
GET /v1/api-keyGET /v1/api-key at $Metered.
POST /v1/chat/completionsInference call — price by token or request.
GET /v1/chat/deferred-completion/{request_id}Inference call — price by token or request.
POST /v1/completePOST /v1/complete at $Metered.
POST /v1/completionsInference call — price by token or request.
POST /v1/documents/searchDiscovery call — use when you lack a known handle.
GET /v1/embedding-modelsGET /v1/embedding-models at $Metered.
GET /v1/embedding-models/{model_id}GET /v1/embedding-models/{model_id} at $Metered.
Evidence (Cleared)
- → Intake verified · Gateway-eligible
- → Trust 70/100 · pass · tier listed
- → Protocol mpp
- → Manifest reachable · schema valid
- → Found listing — indexed from public x402.json, not operator-attested.
Endpoints
Get information about an API key, including name, status, permissions and users who created or modified this key.
Not used$MeteredGET https://docs.x.ai/v1/api-keyCreate a chat response from text/image chat prompts. This is the endpoint for making requests to chat and image understanding models.
Not used$MeteredPOST https://docs.x.ai/v1/chat/completionsTries to fetch a result for a previously-started deferred completion. Returns `200 Success` with the response body, if the request has been completed. Returns `202 Accepted` when the request is pending processing.
Not used$MeteredGET https://docs.x.ai/v1/chat/deferred-completion/{request_id}(Legacy - Not supported by reasoning models) Create a text completion response. This endpoint is compatible with the Anthropic API.
$MeteredPOST https://docs.x.ai/v1/complete(Legacy - Not supported by reasoning models) Create a text completion response for a given prompt. Replaced by /v1/chat/completions.
$MeteredPOST https://docs.x.ai/v1/completionsSearch for content related to the query within the given collections.
$MeteredPOST https://docs.x.ai/v1/documents/searchList all embedding models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, fingerprint and alias(es).
$MeteredGET https://docs.x.ai/v1/embedding-modelsGet full information about an embedding model with its model_id.
$MeteredGET https://docs.x.ai/v1/embedding-models/{model_id}Create an embedding vector representation corresponding to the input text. This is the endpoint for making requests to embedding models.
$MeteredPOST https://docs.x.ai/v1/embeddingsList files owned by the authenticated team, paginated. The response always returns a `pagination_token`; pass it back as a query parameter to fetch the next page. The end of the list is reached when the returned `data` array is shorter than `limit`.
$MeteredGET https://docs.x.ai/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 attachments). Maximum file size: 50 MB. Files are kept until you delete them, or until `expires_after` elapses if set at upload time.
$MeteredPOST https://docs.x.ai/v1/filesRetrieve 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`.
$MeteredGET https://docs.x.ai/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 longer be referenced in chat attachments.
$MeteredGET https://docs.x.ai/v1/files/{file_id}Download the contents of a file as a stream of raw bytes. The response `Content-Type` is `application/octet-stream`. Use this for the binary payload; use `GET /v1/files/{file_id}` for metadata only.
$MeteredGET https://docs.x.ai/v1/files/{file_id}/contentCreate a permanent, unauthenticated public URL for an existing file. The underlying file is unaffected and can still be fetched through the authenticated content endpoint. Use this when you want to share a stored asset (image, video, PDF) outside your API-keyed environment. Public URLs can be revoked at any time via `POST /v1/files/{file_id}/public-url/revoke`.
$MeteredPOST https://docs.x.ai/v1/files/{file_id}/public-urlRevoke the active public URL for a file. The underlying file remains available through the authenticated content endpoint. Revoke is idempotent — calling it on a file without an active public URL returns `revoked: false` without an error.
$MeteredPOST https://docs.x.ai/v1/files/{file_id}/public-url/revokeList all image generation models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, fingerprint and alias(es).
$MeteredGET https://docs.x.ai/v1/image-generation-modelsGet full information about an image generation model with its model_id.
$MeteredGET https://docs.x.ai/v1/image-generation-models/{model_id}Edit an image based on a prompt. This is the endpoint for making edit requests to image generation models.
$MeteredPOST https://docs.x.ai/v1/images/editsGenerate an image based on a prompt. This is the endpoint for making generation requests to image generation models.
$MeteredPOST https://docs.x.ai/v1/images/generations`GET /v1/images/{request_id}`: 202 while pending, 200 with `data` when done or with `error` when failed (a failed generation is a body, not an HTTP error, so pollers do not retry-storm).
$MeteredGET https://docs.x.ai/v1/images/{request_id}List all chat and image understanding models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, fingerprint and alias(es).
$MeteredGET https://docs.x.ai/v1/language-modelsGet full information about a chat or image understanding model with its model_id.
$MeteredGET https://docs.x.ai/v1/language-models/{model_id}Get information about the currently authenticated caller. Works with both API keys and OAuth tokens. Returns identity, team, and ZDR status.
$MeteredGET https://docs.x.ai/v1/meCreate a messages response. This endpoint is compatible with the Anthropic API.
$MeteredPOST https://docs.x.ai/v1/messagesList all models available to the authenticating API key, including model names (ID), creation times, and pricing.
$MeteredGET https://docs.x.ai/v1/modelsGet information about a model with its model_id, including pricing.
$MeteredGET https://docs.x.ai/v1/models/{model_id}Generates a response based on text or image prompts. The response ID can be used to retrieve the response later or to continue the conversation without repeating prior context. New responses will be stored for 30 days and then permanently deleted.
$MeteredPOST https://docs.x.ai/v1/responsesCompacts a full Responses API input window into a shorter canonical window.
$MeteredPOST https://docs.x.ai/v1/responses/compactThe client sends its current input (the same items that would be passed to `POST /v1/responses`) and receives a compacted output window. The output should be used **verbatim** as the `input` of the next `/v1/responses` call (appending only the new user turn). This generalizes the compaction approach used by the coding-agent harness (`generate_session_compact` in xai-grok-shell): 1. Strip tool-result noise from the history. 2. Ask the model to produce a structured `<summary>` of the conversation. 3. Rebuild a compact window: system message → summary → last user query. 4. Return that window to the client.
Retrieve a previously generated response.
$MeteredGET https://docs.x.ai/v1/responses/{response_id}Delete a previously generated response.
$MeteredGET https://docs.x.ai/v1/responses/{response_id}List input items for a previously generated response.
$MeteredGET https://docs.x.ai/v1/responses/{response_id}/input_itemsReturns a paginated list of the input items that were part of the conversation context for the given response.
handle_list_skills_request
$MeteredGET https://docs.x.ai/v1/skillshandle_upload_skill_request
$MeteredPOST https://docs.x.ai/v1/skillshandle_retrieve_skill_request
$MeteredGET https://docs.x.ai/v1/skills/{skill_id}handle_delete_skill_request
$MeteredGET https://docs.x.ai/v1/skills/{skill_id}handle_download_skill_content_request
$MeteredGET https://docs.x.ai/v1/skills/{skill_id}/contentTokenize text with the specified model
$MeteredPOST https://docs.x.ai/v1/tokenize-textList all video generation models available to the authenticating API key with full information.
$MeteredGET https://docs.x.ai/v1/video-generation-modelsGet full information about a video generation model with its model_id.
$MeteredGET https://docs.x.ai/v1/video-generation-models/{model_id}Edit a video based on a prompt. This is an asynchronous operation that returns a request_id for polling.
$MeteredPOST https://docs.x.ai/v1/videos/editsExtend a video by generating continuation content. This is an asynchronous operation that returns a request_id for polling.
$MeteredPOST https://docs.x.ai/v1/videos/extensionsGenerate a video from a text prompt and optionally an image. This is an asynchronous operation that returns a request_id for polling.
$MeteredPOST https://docs.x.ai/v1/videos/generationsGet the result of a deferred video generation request.
$MeteredGET https://docs.x.ai/v1/videos/{request_id}Returns the current status of a video generation job. When the job completes successfully the response contains the generated video URL. When the job fails the response contains a structured `error` object with a machine-readable `code` and a human-readable `message`. Both successful and failed completions return HTTP 200 — use the `status` field (`"done"` or `"failed"`) to distinguish between the two.
Checks
reachable
valid
2026-10-08T14:31:25.974Z
No settlement evidence found in chain signals.
Gateway routing
Score ≥70/100 — Cleared attestation pass. Route via Gateway before pay.
Claim this listing to upgrade to Cleared attestation.
Claim listing