> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mynth.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload Input Images

> Upload images to Mynth and reuse the returned URLs in generation requests.

Use `POST /image/upload` when you want Mynth-hosted URLs for input images.

## Upload files

```bash theme={"theme":"kanagawa-dragon"}
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:

```json theme={"theme":"kanagawa-dragon"}
{
  "data": {
    "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

```ts theme={"theme":"kanagawa-dragon"}
const uploadUrls = await uploadImagesSomehow();

const task = await mynth.image.generate({
  prompt: "Luxury watch campaign shot with dramatic reflections",
  model: "xai/grok-imagine-image",
  inputs: [
    {
      type: "image",
      source: {
        type: "url",
        url: uploadUrls[0],
      },
    },
  ],
});
```

## Important

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

Grok Imagine supports up to 3 input images.
