upload_file
Upload a local image or video file to get a private file_id, reusable for generating, editing, or extending videos.
Instructions
Upload a local image or video file to the xAI Files API and get a file_id. The file stays private; the returned file_id can be used as input for generate_video (image_file_id, reference_images[].file_id), edit_video, and extend_video (video_file_id). Useful for reusing the same asset across multiple calls without re-uploading. Supported: images (jpg/jpeg/png/gif/webp/bmp/tiff) and videos (mp4), max 48 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Local path of the image or video file to upload |