destination option on POST /image/generate when you want each successful image uploaded to storage you control. By default, Mynth only stores images on the Mynth CDN — no destination is required.
Skip destinations when the Mynth CDN URL (mynth_url) is enough, or when you re-upload from that URL yourself.
Destinations are for output delivery. To send input images into generation, see Upload Input Images.
Pricing
Destination delivery is included with image generation. Mynth does not charge an extra fee for uploading to your destination. You still pay generation cost per successful image. Your storage provider may bill for storage and egress separately.Create a destination
Create destinations in the destinations dashboard. That is the primary path for most teams.- Open the destinations dashboard.
- Create a destination with a slug (
name), provider credentials, and path config. - Optionally run a test upload from the dashboard to verify credentials.
/^[a-z0-9-]+$/ (1–64 characters): lowercase letters, digits, and dashes only.
Supported providers:
Management API routes (
/destinations) require OAuth login, not API keys. Use the dashboard, or create via REST after OAuth (see below).
Pass a destination on generate
Reference the destination by its slug:MYNTH_DESTINATION:
Read delivery fields on the result
When a destination is requested, each successful image includes delivery fields. Success withurl_template configured:
Without
url_template, a successful destination upload still stores the object, but url is null. Read mynth_url (or build the public URL yourself from the resolved path).
task.urls in the SDK only includes non-null url values. Prefer task.getImages() and read url / mynth_url / destination when you use destinations.
Handle delivery failure
Destination upload runs after the image is generated. Delivery failure does not fail generation. If destination upload fails:- The image result still has
status: "success" mynth_urlstill points at the Mynth CDNurlisnulldestinationis:
Optional error fields:
message, provider_response.
Always check destination.status per image when you depend on your own storage.
Configure path and URL templates
When you create or update a destination, set:
Mynth resolves
path_template, uploads the file to that path, then builds url from url_template by substituting {path}. Double slashes in the resulting URL (except after https:) are collapsed to a single slash.
Path template tokens
Rules:
- The output format extension is always appended (
.webp,.png, or.jpg). Do not put the extension inpath_template. {meta.key}only substitutes string metadata values. Missing or non-string values become the literal textundefined.- Metadata keys in templates may use letters, digits, and underscores only:
{meta.userId}, not{meta.user-id}.
metadata: { "campaign": "spring" }, output.format: "webp", and image id img_abc, the object path becomes:
url becomes:
{meta.key}.
REST example
Generate with a destination (API key auth):destination as shown above.
Create a destination via API (OAuth)
Management routes require OAuth, not an API key:How destinations fit generation
- Mynth generates the image and post-processes it (
output.format/quality). - Mynth uploads the image to the Mynth CDN and, if
destinationwas set, to your storage in parallel. - The result sets
mynth_urlto the CDN URL. - If destination upload succeeded,
destination.statusis"success"andurlis theurl_templateresult (ornullwithouturl_template). - If destination upload failed, the image remains successful:
urlisnull,mynth_urlis still set, anddestinationreports the error.
image.generate task. Completed generate webhooks include per-image destination when a destination was requested.
Related guides
- Generate Images — full generate request options
- Use Metadata — request metadata and
{meta.key}path tokens - Upload Input Images — inputs for generation, not output storage
- Use Webhooks — receive completed results with destination fields