---
title: "Upload a reference image"
method: POST
path: "/image/upload"
tags: ["Images"]
---

# Upload a reference image

`POST /image/upload`

## Request

- Base URL: `https://api.wondercraft.ai/v1`
- URL: `https://api.wondercraft.ai/v1/image/upload`
- Auth: API key in header `X-API-KEY`
- TypeScript: <https://skmtc.dev/wondercraft/apis/wondercraft-public-api/docs/image/upload/post.ts> (a function with typed inputs; its response is checked against the schema)

Uploads a PNG, JPEG or WebP image (up to 20 MB) to use as a reference when generating images
or videos. Returns an `image_id` to pass in `reference_image_ids` (or as a video start/end frame).
Requires a valid `X-API-KEY` header.

Throws:
- 400 if the file is not a PNG, JPEG or WebP image, or its dimensions are too large
- 413 if the file is larger than 20 MB

## Request body `multipart/form-data`

- BodyUploadImageImageUploadPost
  - `image` string, binary, required: PNG, JPEG or WebP image, up to 20 MB

## Response `200`

Successful Response

- UploadImageResponse
  - `image_id` string, uuid, required: Pass this ID in `reference_image_ids` when generating
  - `width` integer, required: Image width in pixels
  - `height` integer, required: Image height in pixels

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-16** `200f24d7f14b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/wondercraft/apis/wondercraft-public-api/changes/image/upload/post.md)

---

[API](https://skmtc.dev/wondercraft/apis/wondercraft-public-api.md) - [All operations](https://skmtc.dev/wondercraft/apis/wondercraft-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/wondercraft/apis/wondercraft-public-api/revisions/200f24d7f14b?raw)
