Upload Files
Learn how to upload and manage files with V3’s persistent file storage system.Overview
V3 introduces persistent file storage that allows you to:- Upload files once
- Reference them in multiple requests
- Reduce upload overhead
- Manage file lifecycle
Upload a File
Response
Use Uploaded File
Once uploaded, reference the file by itsfile_id in any Universal AI request:
Supported File Types
| Category | Formats |
|---|---|
| Documents | PDF, DOC, DOCX, TXT |
| Images | JPG, JPEG, PNG, GIF, BMP, TIFF, WEBP |
| Data | CSV, JSON, XML |
File Size Limits
- Default maximum: 100 MB per file
- Actual limits may vary by feature and provider
- Check provider-specific documentation for exact limits
File Expiration
Files are automatically deleted after a retention period:- Default retention: 7 days
- Files expire at the timestamp shown in
expires_at - Expired files cannot be recovered
- Upload new files as needed
Upload Multiple Files
Error Handling
Best Practices
1. Reuse Files
Upload once, use in multiple requests:2. Track File Metadata
Keep track of uploaded files:3. Handle Large Files
For large files, show upload progress:Common Errors
413 Payload Too Large
File exceeds size limit. Compress or split the file.415 Unsupported Media Type
File format not supported. Check supported formats above.422 Validation Error
Invalid request format. Ensure file field is properly set.Next Steps
- OCR Features - Use uploaded files for OCR
- Image Features - Image processing
- Universal AI Getting Started - Using files in Universal AI