Beautiful gpt image 1 text to image. Generate high-quality AI visuals and illustrations with ease and speed.
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 idResponse Example
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
prompt | string | ✅ Yes | - | 1–32000 chars | A text description of the desired image(s). The maximum length is 32000 characters. |
n | integer | ❌ No | 1 | 1-10 | The number of images to generate. Must be between 1 and 10. |
size | string | ❌ No | 1024x1024 | 1024x10241536x10241024x15362048x20482048x11523840x21602160x3840or any valid custom size | The size of the generated images. For gpt-image-1: one of 1024x1024, 1536x1024, or 1024x1536. For gpt-image-2: supports arbitrary resolutions (max edge ≤ 3840px, both sides must be multiples of 16px, aspect ratio ≤ 3:1, total pixels between 655,360 and 8,294,400). |
quality | string | ❌ No | auto | autohighmediumlow | The quality of the generated images. One of auto, low, medium, or high. Defaults to auto. Not supported by -plus suffixed models. |
enable_sync_mode | boolean | ❌ No | false | truefalse | Whether to enable synchronous mode for image generation. When enabled, the API will wait until the image is fully generated before returning the response. |
response_format | string | ❌ No | url | urlb64_json | The format in which the generated images are returned. url returns a temporary URL, b64_json returns base64-encoded JSON. |
| 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) |