GPT Image
gpt-image-1 model to generate images, compatible with the OpenAI Images API format.
Generate Image
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Fixed as gpt-image-1 |
prompt | string | Yes | Image description prompt |
n | integer | No | Number of images to generate, default 1 |
size | string | No | Image size: 1024x1024 (default), 1536x1024, 1024x1536, auto |
quality | string | No | Quality: auto (default), low, medium, high |
background | string | No | Background: auto (default), transparent, opaque |
output_format | string | No | Output format: png (default), jpeg, webp |
Request Examples
Response Example
Edit Image
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Fixed as gpt-image-1 |
image | file | Yes | Original image file (multipart) |
prompt | string | Yes | Edit description |
mask | file | No | Mask image, transparent areas indicate regions to edit |
n | integer | No | Number of images to generate |
size | string | No | Output size |
Request Example
Python
GPT Image supports transparent background output. Set
background: "transparent" and use PNG format.