Skip to main content
Use POST /image/upload when you want Mynth-hosted URLs for reference, context, or init images.

Upload files

curl https://api.mynth.io/image/upload \
  -X POST \
  -H "Authorization: Bearer $MYNTH_API_KEY" \
  -F "images=@./reference-1.png" \
  -F "images=@./reference-2.jpg"
Response:
{
  "urls": ["https://cdn.example.com/inputs/...", "https://cdn.example.com/inputs/..."]
}

Supported file types

  • image/jpeg
  • image/png
  • image/webp

Upload limits

  • minimum file size: 1 KB
  • maximum file size: 10 MB per file
  • maximum files per request: 10

Use uploaded URLs in a generation request

const uploadUrls = await uploadImagesSomehow();

const task = await mynth.generate({
  prompt: "Luxury watch campaign shot with dramatic reflections",
  model: "google/gemini-3.1-flash-image",
  inputs: [
    {
      type: "image",
      role: "reference",
      source: {
        type: "url",
        url: uploadUrls[0],
      },
    },
  ],
});

Input roles

Mynth supports these structured image input roles:
  • context
  • init
  • reference
Use string URLs only for the shorthand form. Use the structured object when the role matters.

Important

Input images are validated against the selected model’s capabilities. If the model does not support inputs, the request fails validation.