Search Documentation
Search for a documentation page...
Images API
REST API endpoints for uploading and generating product images and videos.
Uploading images
Image upload moved to the Media API. Use POST /api/v1/media to upload files (multipart/form-data, up to 10 files of 25 MB each under the file field) or to ingest remote image URLs as JSON. It returns catalogued media records with CDN URLs you can use anywhere a product, collection, or post expects an image.
Generate Image
Kicks off an asynchronous image generation from a text prompt through the AI Gateway. Returns immediately with a generation id and pending status; poll GET /api/v1/images/generations/:id for the result. Metered against the store's credit balance and surfaces in Image Studio. Timeout: 30 seconds to start the generation – the render itself finishes in the background.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text prompt (1-1000 characters) |
format | string | No | Image format: square (1:1), horizontal (16:9), or vertical (9:16). Defaults to square |
type | string | No | Deprecated, use format. Legacy image type: product (→ square), collection (→ vertical), hero (→ horizontal) |
model | string | No | fast, balanced (default), or quality – or an AI Gateway image model id (e.g. openai/gpt-image-2) to use that model directly. Only models from bfl, google, openai and xai are accepted; any other maker is rejected with 400. Renders are billed at their actual cost |
productId | string | No | Product to associate the generation with, so it appears on that product's Image Studio tab |
Response
Errors
| Status | Meaning |
|---|---|
402 | Insufficient credits to generate an image |
404 | productId does not belong to the store |
500 | Couldn't start the generation workflow |
Generate Video
Kicks off an asynchronous video generation through the same Image Studio pipeline: prompt-to-video by default, or image-to-video when sourceImageUrl is given. Returns immediately with a generation id and pending status; poll GET /api/v1/images/generations/:id for the result – images and videos share the same generations queue. Billed per rendered second against the store's credit balance. Timeout: 30 seconds to start the generation.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | What the clip shows – subject, motion, mood (1-1000 characters). With sourceImageUrl, directs how that image is animated |
sourceImageUrl | string | No | Image to animate (image-to-video) – a product photo, a media library file, or the URL of a completed image generation. Omit for prompt-to-video |
format | string | No | Clip format: square (1:1), horizontal (16:9), or vertical (9:16). Defaults to square |
duration | number | No | Clip length in seconds, 1-10. Defaults to 6. Billed per second |
model | string | No | fast (480p), balanced (720p, default), or quality (1080p) – or an AI Gateway video model id (e.g. google/veo-3.1-generate-001) to use directly. Only models from bfl, google, openai and xai are accepted; any other maker is rejected with 400. The model must support the requested format, duration and quality, or the generation fails. Clips are billed at their actual cost |
quality | string | No | standard (480p), high (720p), or full-hd (1080p). Defaults to the mode's resolution |
productId | string | No | Product to associate the generation with, so it appears on that product's Image Studio tab |
Response
Errors
| Status | Meaning |
|---|---|
402 | Insufficient credits to generate a video |
404 | productId does not belong to the store |
500 | Couldn't start the generation workflow |
List Generations
Lists the store's image and video generations, newest first, across all products.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 40 | Generations per page (1-100) |
offset | number | 0 | Generations to skip |
source | string | – | Filter by origin: studio (the in-app Image Studio) or api (this endpoint) |
type | string | – | Filter by media type: image or video |
Response
Get Generation
Poll the status and result of a generation started with POST /api/v1/images/generate or POST /api/v1/videos/generate. Store-scoped – a store can only read its own generations.
Response
Status Values
| Status | Meaning |
|---|---|
pending | Queued, not started yet |
processing | Generation in progress |
completed | Finished – url holds the result |
failed | Failed – error explains why |
A 404 is returned when no generation with that id belongs to the store.