POST /v1/files
Upload a file that can be used across various endpoints. The file size limit is 512 MB.Authentication
Requires provider authentication headers:Request
Headers
The provider to route the request to (e.g.,
openai, azure-openai)Bearer token for the provider API
Optional config for routing, retries, fallbacks
Body (multipart/form-data)
The file to upload. Supported formats depend on the provider.
The intended purpose of the uploaded file. Common values:
fine-tune- For fine-tuning training dataassistants- For use with assistantsbatch- For batch API requests
Response
The file identifier
The object type, always “file”
The size of the file in bytes
Unix timestamp of when the file was created
The name of the file
The purpose of the file
Example
Response Example
Error Handling
Error information if the request fails
Best Practices
Files are processed asynchronously. For large files, use the retrieve endpoint to check the file status before using it.
Related Endpoints
List Files
View all uploaded files
Retrieve File
Get file metadata
Delete File
Delete an uploaded file