v1

latestOpenAPI 3.1.0Apache 2.02026-07-264001921002.3 KB
Images

Edit an image

Edits an image using a text prompt and optional mask. Request must be sent as multipart/form-data with at least model, prompt (unless type is background_removal), and image (or image[]).

post/v1/images/edits

Response

Successful response. Returns JSON for non-streaming requests, or Server-Sent Events (SSE) stream when stream=true. When streaming, events are sent with the following event types:

  • image_edit.partial_image: Intermediate image chunks with base64-encoded image data
  • image_edit.completed: Final event for each image with usage information
  • error: Error events with error details
idstring

Unique identifier for the generation request

createdinteger

Unix timestamp when the image was created

modelstring

Model used for generation

backgroundstring

Background type for the image

output_format'png' | 'webp' | 'jpeg'

Output image format

qualitystring

Quality of the generated image

size'256x256' | '512x512' | '1024x1024' | '1792x1024' | '1024x1792' | '1536x1024' | '1024x1536' | 'auto'

Size of the generated image