Image Retention
Every completed generation provides a hosted URL on the Mindrift CDN (cdn.mindrift.art). By default, generated assets are retained indefinitely. You can control retention by configuring automatic expiration with ttl or by deleting images manually via the API.
Default Retention
If you omit ttl (or pass ttl: null), your images are stored indefinitely and remain accessible at their CDN URL.
Automatic Expiration (ttl)
To configure automatic expiration, pass ttl (lifetime in seconds) when requesting an image:
POST /v1/images/generations(synchronous)POST /v1/text-to-image/subscribe/{model}(asynchronous)
The expiration time is computed from the creation timestamp. API responses include the resulting expiration date as expires_at (ISO 8601 timestamp):
Once expired, the media assets are permanently removed and their CDN URLs become inaccessible. If you use Webhooks, expires_at is included in the webhook payload so your services can download or archive files before expiration.
Manual Deletion
You can permanently delete any hosted image at any time using the image deletion endpoint:
- Identifier: Use the image or task ID returned during generation.
- Idempotent: Deleting an already purged image returns
200 OK. - Security: Requesting non-existent IDs or images belonging to another account returns
404 Not Found. - Immediate: Media is removed immediately from storage and edge caches.
Post-Deletion Behavior
After an image is deleted (either automatically via ttl or manually):
- The CDN URL immediately returns
404 Not Found. - The task record remains accessible via
GET /v1/tasks/{task_id}, withoutput.imagesemptied,purged: true, andpurged_atpopulated. - Generation logs, parameters, and billing records remain preserved for your account history.
Error Handling
If a manual deletion request cannot be completed, the API returns 502 Bad Gateway (IMAGE_PURGE_FAILED). You can safely retry the request.
