Lifecycle & Expiry
Uploaded files have a finite lifetime. ai& cleans up expired files automatically and lets you delete files on demand.
Default retention
Section titled “Default retention”Files are retained for 30 days after upload by default. You can set a shorter expiry on individual uploads where the SDK supports it, or delete files explicitly at any time.
Manual deletion
Section titled “Manual deletion”curl -X DELETE https://api.aiand.com/v1/files/file-abc123 \ -H "Authorization: Bearer sk-..."The file becomes inaccessible immediately. A subsequent GET returns 404.
Automatic cleanup
Section titled “Automatic cleanup”Once a file passes its expires_at, it is removed automatically — bytes and metadata both. Subsequent reads return 404.
What happens to references
Section titled “What happens to references”Once a file is deleted, any chat request that references its file_id returns an error. Deletion is not reversible — re-upload the file to use it again.