CDN URLs & Size Variants
Every generation returns CDN URLs immediately, before the assets finish generating. You can embed these URLs in your app right away - they work from the moment you receive them.
How Instant CDN URLs Work
When you call the generate endpoint, Masko uploads a branded placeholder to the CDN path and returns the URL in the response. Your app can start using this URL immediately. Once generation completes, the real asset file replaces the placeholder at the same URL - seamlessly, with no URL change needed on your side.
This means you can build your UI, set up image tags, and configure video players before any generation finishes. The placeholder is a lightweight branded image that signals "generating" to users.
CDN URLs serve a branded Masko placeholder until generation completes. No broken images, no loading spinners - just a smooth transition from placeholder to final asset.
URL Format
CDN URLs follow this structure:
https://assets.masko.ai/{user_prefix}/{collection_slug}/{item_slug}-{hash}.{ext}
Example:
https://assets.masko.ai/u/felix-the-fox/waving-hello-a1b2c3d4.png- user_prefix - Your account prefix (e.g.
u), set automatically. - collection_slug - Derived from the collection name. Can be changed via the cdn-slug endpoint.
- item_slug - Derived from the item name when created.
- hash - Short unique hash to prevent collisions.
- ext - File extension based on asset type (png, mp4, webm, mov).
Size Variants
When creating a collection with CDN enabled, you can configure animation_sizes in the settings to generate pre-rendered size variants of your animations. Size variants are free - no extra credits.
Size variant URLs append the resolution suffix before the extension:
# Original (full resolution)
https://assets.masko.ai/u/felix-the-fox/waving-a1b2.webm
# 720p variant
https://assets.masko.ai/u/felix-the-fox/waving-a1b2-720.webm
# 360p variant
https://assets.masko.ai/u/felix-the-fox/waving-a1b2-360.webmCheck CDN Status
Get the CDN publishing status for all assets in a collection. Shows which assets have been published, their file sizes, and current status.
/v1/collections/:id/cdn-statuscurl https://api.masko.ai/v1/collections/COLLECTION_ID/cdn-status \
-H "Authorization: Bearer masko_YOUR_API_KEY"Get All URLs
Retrieve all URLs for every item in a collection, organized by item. Returns CDN URLs when available, falling back to signed storage URLs.
/v1/collections/:id/urlscurl https://api.masko.ai/v1/collections/COLLECTION_ID/urls \
-H "Authorization: Bearer masko_YOUR_API_KEY"Change Slug
Update the collection's CDN slug. This changes the URL path for all future assets. Existing CDN URLs are not affected - only new publishes use the new slug.
/v1/collections/:id/cdn-slugcurl -X PATCH https://api.masko.ai/v1/collections/COLLECTION_ID/cdn-slug \
-H "Authorization: Bearer masko_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"slug": "felix"
}'Slugs must be 2-50 characters, lowercase alphanumeric with dashes. Each slug must be unique across all collections.
Disabling CDN
If you do not need CDN URLs, set cdn_enabled: false in the collection settings when creating or updating the collection. This skips placeholder uploads and CDN URL allocation. Assets are still generated and accessible via signed storage URLs through the jobs endpoint.