ImageCreates an edited or extended image given an original image and a prompt.Related Guides: Image GenerationEdit an existing image based on the prompt.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | ✅ Yes | gpt-image-1 | The model to use for the request |
image | file | ✅ Yes | - | The image to edit. Must be a valid PNG file, less than 4MB, and square. |
prompt | string | ✅ Yes | A cat wearing a hat | A text description of the desired image(s). The maximum length is 1000 characters. |
mask | file | ❌ No | - | An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image. |
n | integer | ❌ No | 1 | The number of images to generate. Must be between 1 and 10. |
size | string | ❌ No | 1024x1024 | The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024. |