Files API

Files REST API Overview

The Files API allows you to upload, manage, and download files for use with Grok models. Files can be attached to chat messages for document understanding, or added to collections for semantic search.

The base URL for all file operations is https://api.x.ai. You have to authenticate with the header Authorization: Bearer <your xAI API key>.