/filesUpload a file
Uploads a file for use across supported API endpoints. Send the file and its purpose as multipart form data, and use expires_after when you want to set an expiration policy. File uploads are limited to 512 MB per file and 2.5 TB of storage per project.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Multipart form data containing the file, its intended purpose, and an optional expiration policy.
A 400 is returned when the upload request is invalid or exceeds a file-size or storage quota limit; file and purpose are required, and purpose must be one of assistants, batch, fine-tune, vision, user_data, or evals. If provided, expires_after.anchor must be created_at and expires_after.seconds must be between 3,600 and 2,592,000. A 429 is returned when too many file requests are made, and a 500 is returned when a server error prevents the upload.