Skip to main content
Use this exact model ID:

Synchronous Generate body

Send this JSON to /v1/images/generations for synchronous work. Set size explicitly when downstream storage or layout depends on exact pixels. The public API does not define the output dimensions produced by an omitted value.

Unified asynchronous body

Send JSON to /v1/images/tasks. Generation uses action=generate and omits input_images. Editing accepts 1–16 items; this two-image request combines references:
Use raw Base64 without a data URL prefix. Each decoded source must not exceed 20 MiB, all sources together must not exceed 64 MiB, and mime_type must match the PNG, JPEG, or WebP bytes. Omit aspect_ratio. Add Idempotency-Key to retryable submissions. The key is limited to 255 bytes; the same key and body replay the task, while a changed body returns HTTP 409.

Edit form

POST /v1/images/edits uses multipart/form-data: Synchronous multipart Edit covers one source image. Use the unified task endpoint for multiple references. Synchronous multipart Edit does not publish one fixed source-image byte or pixel limit. If the gateway returns HTTP 413, reduce the image and total multipart body before retrying; the unified JSON task limit remains 20 MiB decoded. See errors and safe retries.

Response

Successful Generate and Edit responses contain one image:
Decode b64_json before writing the PNG. Do not expect a hosted image URL.

Controls outside this reverse-image route

The public contract does not include masks, n > 1, partial-image streaming, output format/compression, transparency, callbacks, or cancellation. Completed tasks preserve native ImagesResponse under result, expose result_expires_at, and expire the image after 24 hours.

Copy Web examples

Use complete synchronous, asynchronous, and editing flows.
Last modified on September 3, 2026