Edit and modify images using GPT Image 1.5 model with precise control over quality and output format
enable_sync_mode set to true (some models do not support this parameter, but you still need to query the result by id), you must call the Query Result endpoint to retrieve the final output.
data.id – the unique identifier of the predictiondata.urls[0].get – a ready-to-use GET URL that already embeds the id| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
model | string | ✅ Yes | - | - | The model to use for image editing |
prompt | string | ✅ Yes | - | - | A text description of the desired image(s). The maximum length is 32000 characters. |
image | string or file | ❌ No | - | - | Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images. |
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
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 | 1-10 | The number of images to generate. Must be between 1 and 10. |
size | string | ❌ No | 1024x1024 | 256x256512x5121024x10241536x10241024x1536 | The size of the generated images. |
quality | string | ❌ No | medium | highmediumlow | The quality of the generated images. |
background | string | ❌ No | auto | transparentopaqueauto | Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image. |
enable_sync_mode | boolean | ❌ No | false | truefalse | Whether to enable synchronous mode for image generation. |
response_format | string | ❌ No | url | urlb64_json | The format in which the generated images are returned. |
| Error Code | Error Name | Description |
|---|---|---|
| 401 | Unauthorized | API key is missing or invalid |
| 403 | Forbidden | Your API key doesn’t have permission to access this resource, or insufficient balance for the requested operation |
| 429 | Too Many Requests | You’ve exceeded your rate limit |
| 500 | Internal server error | An internal server error occurred |
| 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) |