Generate images from text descriptions
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | ✅ Yes | a cat | A text description of the desired image(s). The maximum length is 32000 characters for gpt-image-1. |
n | integer | ❌ No | 1 | The number of images to generate. Must be between 1 and 10. |
background | string | ❌ No | auto | Allows to set transparency for the background of the generated image(s). This parameter is only supported for gpt-image-1. Must be one of transparent, opaque or auto (default value). When auto is used, the model will automatically determine the best background for the image. |
quality | string | ❌ No | auto | The quality of the image that will be generated. Must be one of high, medium, low, or auto (default value) for gpt-image-1. |
size | string | ❌ No | auto | The size of the generated images. Must be one of 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto (default value) for gpt-image-1. |
enable_sync_mode | boolean | ❌ No | false | Whether to enable synchronous mode. Options: false, true |
response_format | string | ❌ No | b64_json | The format in which the generated images are returned. Must be one of url or b64_json. |