Vercel Blob now supports TTLs for automatic deletion
Vercel added TTLs to Vercel Blob, so blobs can delete themselves. Pass ttlDays when you write a blob, from 1 to 730 days, and it's removed that many days after its upload date. It's meant for things you'd otherwise clean up by hand, like session transcripts, exports, and temporary uploads.
ttlDays works on put(), copy(), putImage(), multipart uploads, and presigned upload URLs. Every write result and head() response now includes expiresAt, so you can see when a blob is due to go. For example, put('exports/report.csv', csv, { access: 'private', ttlDays: 7 }) returns an expiresAt seven days out.
For blobs you already have, setTtl() changes or removes the TTL without re-uploading, on one URL or up to 1,000 at a time. Pass null to clear it. In Vercel CLI 65.16.0 and later, vercel blob put, put-image, copy, and presign take --ttl-days, and vercel blob set-ttl handles existing blobs (--clear-ttl removes one). You'll need @vercel/blob@2.9.0.
Setting a TTL costs one Advanced Operation per started 60 days, on top of the write. A 7-day TTL costs one, and the 730-day maximum costs 13. Clearing a TTL and the deletions themselves are free. You can track TTL operations in the Blob section of the Vercel Observability tab.