Destinations

Your storage.Your URL.

Name storage once. Pass the name on a request. Mynth writes each image there before the task completes, and url is on your domain.

Path

url

https://cdn.example.com/campaigns/spring/01HZYX4M6K8P2Q9R0T7W3Y5Z8C.webp

mynth_url

https://cdn.mynth.io/images/img_01KE7XWWEQ4MCGWK.webp

path_template
campaigns/{meta.campaign}/{ulid}
destination
prod-cdn

The date and ids are an example. A real upload uses the time of the upload and a new id per file. mynth_url is Mynth's copy, served for 7 days, and the path template does not change it.

Clear the field and the key is omitted. A missing metadata value is written as the text undefined.

Storage

S3, R2, or Bunny

A destination names one of these. S3 also covers any host that speaks the S3 API.

s3
bucket and region. Set endpoint for Backblaze B2, MinIO, Wasabi, or DigitalOcean Spaces, and force_path_style when the host wants path-style URLs.
r2
account_id and bucket. jurisdiction accepts default, eu, or fedramp.
bunny
storage_zone. region defaults to de, and can be uk, ny, la, sg, se, br, jh, or syd.

The secret is stored apart from the destination, and no endpoint returns it. Create one in the dashboard, then run a test upload before a task depends on it. Destinations has the provider fields and the CLI.

The request

Pass the name, not the id

The field takes the name you created. The rest of the request stays as it was.

destination
The name, such as prod-cdn. 1 to 64 characters, lowercase letters, digits, and dashes. It cannot be changed. A different provider means a new destination. The dst_ id is for managing it.
Default
MYNTH_DESTINATION, or destination passed to new Mynth(). The field on the request wins over both.
Tasks
image.generate, image.remove_background and image.upscale accept it. video.generate drops the field and does not error.
Unknown name
Fails at creation with VALIDATION_ERROR. The task is not queued.

The result

A completed task has already uploaded

Mynth stores its own copy, then streams that copy into your storage. The task completes after the upload.

url
Built from url_template by filling {path}. Leave the template unset and url is null even when the file was stored.
mynth_url
Set whenever the image succeeds. Served for 7 days. Not built from the path template.
Upload failed
The image still succeeds, and url is null. image.generate adds no error. image.remove_background and image.upscale add a destination block.
task.urls
The SDK drops images whose url is null. Read getImages().
Overwrite
A template with no per-file token writes the same key for every image in the task. A count of 4 keeps one file. Include {id} or {ulid}.

Path tokens, retries, and the error codes are in Destinations.

Price

Uploading does not change the price

You pay for the successful image. The upload is not a separate charge. Your storage provider can still bill for the object.

Pricing lists every charge. Delivery is not one of them.