naftiko: 1.0.0-alpha2 info: label: xAI's REST API — v1 description: 'xAI''s REST API — v1. 33 operations. Lead operation: Get information about an API key, including name, status, permissions and users who created or modified this key.. Self-contained Naftiko capability covering one Xai business surface.' tags: - Xai - v1 created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: XAI_API_KEY: XAI_API_KEY capability: consumes: - type: http namespace: xai-v1 baseUri: '' description: xAI's REST API — v1 business capability. Self-contained, no shared references. resources: - name: v1-api-key path: /v1/api-key operations: - name: handlegetapikeyinforequest method: GET description: Get information about an API key, including name, status, permissions and users who created or modified this key. outputRawFormat: json outputParameters: - name: result type: object value: $. - name: v1-chat-completions path: /v1/chat/completions operations: - name: handlegenericcompletionrequest method: POST description: Create a chat response from text/image chat prompts. This is the endpoint for making requests to chat and image understanding models. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-chat-deferred-completion-request_id path: /v1/chat/deferred-completion/{request_id} operations: - name: handlegetdeferredcompletionrequest method: GET description: Tries 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. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: request_id in: path type: string description: The deferred request id returned by a previous deferred chat request. required: true - name: v1-complete path: /v1/complete operations: - name: handlegenericcompleterequest method: POST description: (Legacy - Not supported by reasoning models) Create a text completion response. This endpoint is compatible with the Anthropic API. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-completions path: /v1/completions operations: - name: handlesamplerequest method: POST description: (Legacy - Not supported by reasoning models) Create a text completion response for a given prompt. Replaced by /v1/chat/completions. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-documents-search path: /v1/documents/search operations: - name: handledocumentsearchrequestv2 method: POST description: Search for content related to the query within the given collections. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-embedding-models path: /v1/embedding-models operations: - name: handleembeddingmodelslistrequest method: GET description: List all embedding models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, pricing, fingerprint and alias(es). outputRawFormat: json outputParameters: - name: result type: object value: $. - name: v1-embedding-models-model_id path: /v1/embedding-models/{model_id} operations: - name: handleembeddingmodelgetrequest method: GET description: Get full information about an embedding model with its model_id. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: model_id in: path type: string description: ID of the model to get. required: true - name: v1-embeddings path: /v1/embeddings operations: - name: handleembeddingrequest method: POST description: Create an embedding vector representation corresponding to the input text. This is the endpoint for making requests to embedding models. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-files path: /v1/files operations: - name: handlelistfilesrequest method: GET description: List files owned by the authenticated team, paginated. The response outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: limit in: query type: integer description: The maximum number of objects to be returned in a single response. - name: order in: query type: string description: The ordering to sort the returned files. Use `asc` for ascending and `desc` for descending order. - name: sort_by in: query type: string description: 'The field to sort by. Valid options: `created_at`, `filename`, `size`. Defaults to `created_at`.' - name: pagination_token in: query type: string description: The pagination token returned by the previous list files request. - name: after in: query type: string description: Only included for compatibility. Use `pagination_token` instead. - name: handleuploadfilerequest method: POST description: Upload a file to xAI's storage. Returns the file's metadata. Files can outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-files-file_id path: /v1/files/{file_id} operations: - name: handleretrievefilerequest method: GET description: Retrieve metadata for a single file by ID. Errors with 404 if the file outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: file_id in: path type: string description: The file's `id` returned by upload or list. required: true - name: handledeletefilerequest method: DELETE description: Delete a file by ID. After this returns, the file no longer appears in outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: file_id in: path type: string description: The file's `id` to delete. required: true - name: v1-files-file_id-content path: /v1/files/{file_id}/content operations: - name: handledownloadfilecontentrequest method: GET description: Download the contents of a file as a stream of raw bytes. The response outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: file_id in: path type: string description: The file's `id` to download. required: true - name: format in: query type: string description: Format of the downloaded content. - name: v1-image-generation-models path: /v1/image-generation-models operations: - name: handleimagegenerationmodelslistrequest method: GET description: List all image generation models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, pricing, fingerprint and alias(es). outputRawFormat: json outputParameters: - name: result type: object value: $. - name: v1-image-generation-models-model_id path: /v1/image-generation-models/{model_id} operations: - name: handleimagegenerationmodelgetrequest method: GET description: Get full information about an image generation model with its model_id. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: model_id in: path type: string description: ID of the model to get. required: true - name: v1-images-edits path: /v1/images/edits operations: - name: handleeditimagerequest method: POST description: Edit an image based on a prompt. This is the endpoint for making edit requests to image generation models. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-images-generations path: /v1/images/generations operations: - name: handlegenerateimagerequest method: POST description: Generate an image based on a prompt. This is the endpoint for making generation requests to image generation models. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-language-models path: /v1/language-models operations: - name: handlelanguagemodelslistrequest method: GET description: List all chat and image understanding models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, pricing, fingerprint and alias(es). outputRawFormat: json outputParameters: - name: result type: object value: $. - name: v1-language-models-model_id path: /v1/language-models/{model_id} operations: - name: handlelanguagemodelgetrequest method: GET description: Get full information about a chat or image understanding model with its model_id. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: model_id in: path type: string description: ID of the model to get. required: true - name: v1-messages path: /v1/messages operations: - name: handlegenericmessagesrequest method: POST description: Create a messages response. This endpoint is compatible with the Anthropic API. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-models path: /v1/models operations: - name: handlemodelslistrequest method: GET description: List all models available to the authenticating API key with minimalized information, including model names (ID), creation times, etc. outputRawFormat: json outputParameters: - name: result type: object value: $. - name: v1-models-model_id path: /v1/models/{model_id} operations: - name: handlemodelgetrequest method: GET description: Get minimalized information about a model with its model_id. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: model_id in: path type: string description: ID of the model to get. required: true - name: v1-responses path: /v1/responses operations: - name: handlegenericmodelrequest method: POST description: 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 d outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-responses-response_id path: /v1/responses/{response_id} operations: - name: handlegetstoredcompletionrequest method: GET description: Retrieve a previously generated response. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: response_id in: path type: string description: The response id returned by a previous create response request. required: true - name: handledeletestoredcompletionrequest method: DELETE description: Delete a previously generated response. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: response_id in: path type: string description: The response id returned by a previous create response request. required: true - name: v1-tokenize-text path: /v1/tokenize-text operations: - name: handletokenizetextrequest method: POST description: Tokenize text with the specified model outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-video-generation-models path: /v1/video-generation-models operations: - name: handlevideogenerationmodelslistrequest method: GET description: List all video generation models available to the authenticating API key with full information. outputRawFormat: json outputParameters: - name: result type: object value: $. - name: v1-video-generation-models-model_id path: /v1/video-generation-models/{model_id} operations: - name: handlevideogenerationmodelgetrequest method: GET description: Get full information about a video generation model with its model_id. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: model_id in: path type: string description: ID of the model to get. required: true - name: v1-videos-edits path: /v1/videos/edits operations: - name: handleeditvideorequest method: POST description: Edit a video based on a prompt. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-videos-extensions path: /v1/videos/extensions operations: - name: handleextendvideorequest method: POST description: Extend a video by generating continuation content. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-videos-generations path: /v1/videos/generations operations: - name: handlegeneratevideorequest method: POST description: Generate a video from a text prompt and optionally an image. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-videos-request_id path: /v1/videos/{request_id} operations: - name: handlegetdeferredvideorequest method: GET description: Get the result of a deferred video generation request. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: request_id in: path type: string description: The deferred request id returned by a previous video generation request. required: true authentication: type: bearer token: '{{env.XAI_API_KEY}}' exposes: - type: rest namespace: xai-v1-rest port: 8080 description: REST adapter for xAI's REST API — v1. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/v1/api-key name: v1-api-key description: REST surface for v1-api-key. operations: - method: GET name: handlegetapikeyinforequest description: Get information about an API key, including name, status, permissions and users who created or modified this key. call: xai-v1.handlegetapikeyinforequest outputParameters: - type: object mapping: $. - path: /v1/v1/chat/completions name: v1-chat-completions description: REST surface for v1-chat-completions. operations: - method: POST name: handlegenericcompletionrequest description: Create a chat response from text/image chat prompts. This is the endpoint for making requests to chat and image understanding models. call: xai-v1.handlegenericcompletionrequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/chat/deferred-completion/{request-id} name: v1-chat-deferred-completion-request-id description: REST surface for v1-chat-deferred-completion-request_id. operations: - method: GET name: handlegetdeferredcompletionrequest description: Tries 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. call: xai-v1.handlegetdeferredcompletionrequest with: request_id: rest.request_id outputParameters: - type: object mapping: $. - path: /v1/v1/complete name: v1-complete description: REST surface for v1-complete. operations: - method: POST name: handlegenericcompleterequest description: (Legacy - Not supported by reasoning models) Create a text completion response. This endpoint is compatible with the Anthropic API. call: xai-v1.handlegenericcompleterequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/completions name: v1-completions description: REST surface for v1-completions. operations: - method: POST name: handlesamplerequest description: (Legacy - Not supported by reasoning models) Create a text completion response for a given prompt. Replaced by /v1/chat/completions. call: xai-v1.handlesamplerequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/documents/search name: v1-documents-search description: REST surface for v1-documents-search. operations: - method: POST name: handledocumentsearchrequestv2 description: Search for content related to the query within the given collections. call: xai-v1.handledocumentsearchrequestv2 with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/embedding-models name: v1-embedding-models description: REST surface for v1-embedding-models. operations: - method: GET name: handleembeddingmodelslistrequest description: List all embedding models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, pricing, fingerprint and alias(es). call: xai-v1.handleembeddingmodelslistrequest outputParameters: - type: object mapping: $. - path: /v1/v1/embedding-models/{model-id} name: v1-embedding-models-model-id description: REST surface for v1-embedding-models-model_id. operations: - method: GET name: handleembeddingmodelgetrequest description: Get full information about an embedding model with its model_id. call: xai-v1.handleembeddingmodelgetrequest with: model_id: rest.model_id outputParameters: - type: object mapping: $. - path: /v1/v1/embeddings name: v1-embeddings description: REST surface for v1-embeddings. operations: - method: POST name: handleembeddingrequest description: Create an embedding vector representation corresponding to the input text. This is the endpoint for making requests to embedding models. call: xai-v1.handleembeddingrequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/files name: v1-files description: REST surface for v1-files. operations: - method: GET name: handlelistfilesrequest description: List files owned by the authenticated team, paginated. The response call: xai-v1.handlelistfilesrequest with: limit: rest.limit order: rest.order sort_by: rest.sort_by pagination_token: rest.pagination_token after: rest.after outputParameters: - type: object mapping: $. - method: POST name: handleuploadfilerequest description: Upload a file to xAI's storage. Returns the file's metadata. Files can call: xai-v1.handleuploadfilerequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/files/{file-id} name: v1-files-file-id description: REST surface for v1-files-file_id. operations: - method: GET name: handleretrievefilerequest description: Retrieve metadata for a single file by ID. Errors with 404 if the file call: xai-v1.handleretrievefilerequest with: file_id: rest.file_id outputParameters: - type: object mapping: $. - method: DELETE name: handledeletefilerequest description: Delete a file by ID. After this returns, the file no longer appears in call: xai-v1.handledeletefilerequest with: file_id: rest.file_id outputParameters: - type: object mapping: $. - path: /v1/v1/files/{file-id}/content name: v1-files-file-id-content description: REST surface for v1-files-file_id-content. operations: - method: GET name: handledownloadfilecontentrequest description: Download the contents of a file as a stream of raw bytes. The response call: xai-v1.handledownloadfilecontentrequest with: file_id: rest.file_id format: rest.format outputParameters: - type: object mapping: $. - path: /v1/v1/image-generation-models name: v1-image-generation-models description: REST surface for v1-image-generation-models. operations: - method: GET name: handleimagegenerationmodelslistrequest description: List all image generation models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, pricing, fingerprint and alias(es). call: xai-v1.handleimagegenerationmodelslistrequest outputParameters: - type: object mapping: $. - path: /v1/v1/image-generation-models/{model-id} name: v1-image-generation-models-model-id description: REST surface for v1-image-generation-models-model_id. operations: - method: GET name: handleimagegenerationmodelgetrequest description: Get full information about an image generation model with its model_id. call: xai-v1.handleimagegenerationmodelgetrequest with: model_id: rest.model_id outputParameters: - type: object mapping: $. - path: /v1/v1/images/edits name: v1-images-edits description: REST surface for v1-images-edits. operations: - method: POST name: handleeditimagerequest description: Edit an image based on a prompt. This is the endpoint for making edit requests to image generation models. call: xai-v1.handleeditimagerequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/images/generations name: v1-images-generations description: REST surface for v1-images-generations. operations: - method: POST name: handlegenerateimagerequest description: Generate an image based on a prompt. This is the endpoint for making generation requests to image generation models. call: xai-v1.handlegenerateimagerequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/language-models name: v1-language-models description: REST surface for v1-language-models. operations: - method: GET name: handlelanguagemodelslistrequest description: List all chat and image understanding models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, pricing, fingerprint and alias(es). call: xai-v1.handlelanguagemodelslistrequest outputParameters: - type: object mapping: $. - path: /v1/v1/language-models/{model-id} name: v1-language-models-model-id description: REST surface for v1-language-models-model_id. operations: - method: GET name: handlelanguagemodelgetrequest description: Get full information about a chat or image understanding model with its model_id. call: xai-v1.handlelanguagemodelgetrequest with: model_id: rest.model_id outputParameters: - type: object mapping: $. - path: /v1/v1/messages name: v1-messages description: REST surface for v1-messages. operations: - method: POST name: handlegenericmessagesrequest description: Create a messages response. This endpoint is compatible with the Anthropic API. call: xai-v1.handlegenericmessagesrequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/models name: v1-models description: REST surface for v1-models. operations: - method: GET name: handlemodelslistrequest description: List all models available to the authenticating API key with minimalized information, including model names (ID), creation times, etc. call: xai-v1.handlemodelslistrequest outputParameters: - type: object mapping: $. - path: /v1/v1/models/{model-id} name: v1-models-model-id description: REST surface for v1-models-model_id. operations: - method: GET name: handlemodelgetrequest description: Get minimalized information about a model with its model_id. call: xai-v1.handlemodelgetrequest with: model_id: rest.model_id outputParameters: - type: object mapping: $. - path: /v1/v1/responses name: v1-responses description: REST surface for v1-responses. operations: - method: POST name: handlegenericmodelrequest description: 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 d call: xai-v1.handlegenericmodelrequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/responses/{response-id} name: v1-responses-response-id description: REST surface for v1-responses-response_id. operations: - method: GET name: handlegetstoredcompletionrequest description: Retrieve a previously generated response. call: xai-v1.handlegetstoredcompletionrequest with: response_id: rest.response_id outputParameters: - type: object mapping: $. - method: DELETE name: handledeletestoredcompletionrequest description: Delete a previously generated response. call: xai-v1.handledeletestoredcompletionrequest with: response_id: rest.response_id outputParameters: - type: object mapping: $. - path: /v1/v1/tokenize-text name: v1-tokenize-text description: REST surface for v1-tokenize-text. operations: - method: POST name: handletokenizetextrequest description: Tokenize text with the specified model call: xai-v1.handletokenizetextrequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/video-generation-models name: v1-video-generation-models description: REST surface for v1-video-generation-models. operations: - method: GET name: handlevideogenerationmodelslistrequest description: List all video generation models available to the authenticating API key with full information. call: xai-v1.handlevideogenerationmodelslistrequest outputParameters: - type: object mapping: $. - path: /v1/v1/video-generation-models/{model-id} name: v1-video-generation-models-model-id description: REST surface for v1-video-generation-models-model_id. operations: - method: GET name: handlevideogenerationmodelgetrequest description: Get full information about a video generation model with its model_id. call: xai-v1.handlevideogenerationmodelgetrequest with: model_id: rest.model_id outputParameters: - type: object mapping: $. - path: /v1/v1/videos/edits name: v1-videos-edits description: REST surface for v1-videos-edits. operations: - method: POST name: handleeditvideorequest description: Edit a video based on a prompt. call: xai-v1.handleeditvideorequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/videos/extensions name: v1-videos-extensions description: REST surface for v1-videos-extensions. operations: - method: POST name: handleextendvideorequest description: Extend a video by generating continuation content. call: xai-v1.handleextendvideorequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/videos/generations name: v1-videos-generations description: REST surface for v1-videos-generations. operations: - method: POST name: handlegeneratevideorequest description: Generate a video from a text prompt and optionally an image. call: xai-v1.handlegeneratevideorequest with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/videos/{request-id} name: v1-videos-request-id description: REST surface for v1-videos-request_id. operations: - method: GET name: handlegetdeferredvideorequest description: Get the result of a deferred video generation request. call: xai-v1.handlegetdeferredvideorequest with: request_id: rest.request_id outputParameters: - type: object mapping: $. - type: mcp namespace: xai-v1-mcp port: 9090 transport: http description: MCP adapter for xAI's REST API — v1. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: get-information-about-api-key description: Get information about an API key, including name, status, permissions and users who created or modified this key. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlegetapikeyinforequest outputParameters: - type: object mapping: $. - name: create-chat-response-text-image description: Create a chat response from text/image chat prompts. This is the endpoint for making requests to chat and image understanding models. hints: readOnly: false destructive: false idempotent: false call: xai-v1.handlegenericcompletionrequest with: body: tools.body outputParameters: - type: object mapping: $. - name: tries-fetch-result-previously-started description: Tries 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. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlegetdeferredcompletionrequest with: request_id: tools.request_id outputParameters: - type: object mapping: $. - name: legacy-not-supported-reasoning-models description: (Legacy - Not supported by reasoning models) Create a text completion response. This endpoint is compatible with the Anthropic API. hints: readOnly: false destructive: false idempotent: false call: xai-v1.handlegenericcompleterequest with: body: tools.body outputParameters: - type: object mapping: $. - name: legacy-not-supported-reasoning-models-2 description: (Legacy - Not supported by reasoning models) Create a text completion response for a given prompt. Replaced by /v1/chat/completions. hints: readOnly: false destructive: false idempotent: false call: xai-v1.handlesamplerequest with: body: tools.body outputParameters: - type: object mapping: $. - name: search-content-related-query-within description: Search for content related to the query within the given collections. hints: readOnly: true destructive: false idempotent: false call: xai-v1.handledocumentsearchrequestv2 with: body: tools.body outputParameters: - type: object mapping: $. - name: list-all-embedding-models-available description: List all embedding models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, pricing, fingerprint and alias(es). hints: readOnly: true destructive: false idempotent: true call: xai-v1.handleembeddingmodelslistrequest outputParameters: - type: object mapping: $. - name: get-full-information-about-embedding description: Get full information about an embedding model with its model_id. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handleembeddingmodelgetrequest with: model_id: tools.model_id outputParameters: - type: object mapping: $. - name: create-embedding-vector-representation-corresponding description: Create an embedding vector representation corresponding to the input text. This is the endpoint for making requests to embedding models. hints: readOnly: false destructive: false idempotent: false call: xai-v1.handleembeddingrequest with: body: tools.body outputParameters: - type: object mapping: $. - name: list-files-owned-authenticated-team description: List files owned by the authenticated team, paginated. The response hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlelistfilesrequest with: limit: tools.limit order: tools.order sort_by: tools.sort_by pagination_token: tools.pagination_token after: tools.after outputParameters: - type: object mapping: $. - name: upload-file-xai-s-storage-returns description: Upload a file to xAI's storage. Returns the file's metadata. Files can hints: readOnly: false destructive: false idempotent: false call: xai-v1.handleuploadfilerequest with: body: tools.body outputParameters: - type: object mapping: $. - name: retrieve-metadata-single-file-id description: Retrieve metadata for a single file by ID. Errors with 404 if the file hints: readOnly: true destructive: false idempotent: true call: xai-v1.handleretrievefilerequest with: file_id: tools.file_id outputParameters: - type: object mapping: $. - name: delete-file-id-after-this description: Delete a file by ID. After this returns, the file no longer appears in hints: readOnly: false destructive: true idempotent: true call: xai-v1.handledeletefilerequest with: file_id: tools.file_id outputParameters: - type: object mapping: $. - name: download-contents-file-stream-raw description: Download the contents of a file as a stream of raw bytes. The response hints: readOnly: true destructive: false idempotent: true call: xai-v1.handledownloadfilecontentrequest with: file_id: tools.file_id format: tools.format outputParameters: - type: object mapping: $. - name: list-all-image-generation-models description: List all image generation models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, pricing, fingerprint and alias(es). hints: readOnly: true destructive: false idempotent: true call: xai-v1.handleimagegenerationmodelslistrequest outputParameters: - type: object mapping: $. - name: get-full-information-about-image description: Get full information about an image generation model with its model_id. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handleimagegenerationmodelgetrequest with: model_id: tools.model_id outputParameters: - type: object mapping: $. - name: edit-image-based-prompt-this description: Edit an image based on a prompt. This is the endpoint for making edit requests to image generation models. hints: readOnly: false destructive: false idempotent: false call: xai-v1.handleeditimagerequest with: body: tools.body outputParameters: - type: object mapping: $. - name: generate-image-based-prompt-this description: Generate an image based on a prompt. This is the endpoint for making generation requests to image generation models. hints: readOnly: false destructive: false idempotent: false call: xai-v1.handlegenerateimagerequest with: body: tools.body outputParameters: - type: object mapping: $. - name: list-all-chat-and-image description: List all chat and image understanding models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, pricing, fingerprint and alias(es). hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlelanguagemodelslistrequest outputParameters: - type: object mapping: $. - name: get-full-information-about-chat description: Get full information about a chat or image understanding model with its model_id. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlelanguagemodelgetrequest with: model_id: tools.model_id outputParameters: - type: object mapping: $. - name: create-messages-response-this-endpoint description: Create a messages response. This endpoint is compatible with the Anthropic API. hints: readOnly: false destructive: false idempotent: false call: xai-v1.handlegenericmessagesrequest with: body: tools.body outputParameters: - type: object mapping: $. - name: list-all-models-available-authenticating description: List all models available to the authenticating API key with minimalized information, including model names (ID), creation times, etc. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlemodelslistrequest outputParameters: - type: object mapping: $. - name: get-minimalized-information-about-model description: Get minimalized information about a model with its model_id. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlemodelgetrequest with: model_id: tools.model_id outputParameters: - type: object mapping: $. - name: generates-response-based-text-image description: 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 d hints: readOnly: true destructive: false idempotent: false call: xai-v1.handlegenericmodelrequest with: body: tools.body outputParameters: - type: object mapping: $. - name: retrieve-previously-generated-response description: Retrieve a previously generated response. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlegetstoredcompletionrequest with: response_id: tools.response_id outputParameters: - type: object mapping: $. - name: delete-previously-generated-response description: Delete a previously generated response. hints: readOnly: false destructive: true idempotent: true call: xai-v1.handledeletestoredcompletionrequest with: response_id: tools.response_id outputParameters: - type: object mapping: $. - name: tokenize-text-specified-model description: Tokenize text with the specified model hints: readOnly: false destructive: false idempotent: false call: xai-v1.handletokenizetextrequest with: body: tools.body outputParameters: - type: object mapping: $. - name: list-all-video-generation-models description: List all video generation models available to the authenticating API key with full information. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlevideogenerationmodelslistrequest outputParameters: - type: object mapping: $. - name: get-full-information-about-video description: Get full information about a video generation model with its model_id. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlevideogenerationmodelgetrequest with: model_id: tools.model_id outputParameters: - type: object mapping: $. - name: edit-video-based-prompt description: Edit a video based on a prompt. hints: readOnly: false destructive: false idempotent: false call: xai-v1.handleeditvideorequest with: body: tools.body outputParameters: - type: object mapping: $. - name: extend-video-generating-continuation-content description: Extend a video by generating continuation content. hints: readOnly: false destructive: false idempotent: false call: xai-v1.handleextendvideorequest with: body: tools.body outputParameters: - type: object mapping: $. - name: generate-video-text-prompt-and description: Generate a video from a text prompt and optionally an image. hints: readOnly: false destructive: false idempotent: false call: xai-v1.handlegeneratevideorequest with: body: tools.body outputParameters: - type: object mapping: $. - name: get-result-deferred-video-generation description: Get the result of a deferred video generation request. hints: readOnly: true destructive: false idempotent: true call: xai-v1.handlegetdeferredvideorequest with: request_id: tools.request_id outputParameters: - type: object mapping: $.