Skip to main content
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 and reference them across multiple requests
  • Reduce upload overhead and latency
  • Manage file lifecycle with automatic expiration
Endpoint:

File Intent (purpose)

The purpose field is optional. When provided, it tags the file with its intended use making it easy to filter your uploaded files by intent when retrieving them later.

Upload a File

Response

Use Uploaded File

Once uploaded, reference the file by its file_id in an LLM chat completion:

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

Chat Completions

Use uploaded files in LLM conversations

Streaming

Stream responses when processing documents