Quick Example
- Python
- Node.js
- cURL
Response
The API returns an array of image objects. Depending on yourresponse_format, each object contains either a URL or base64-encoded image data.
Common Parameters
| Parameter | Type | Description |
|---|---|---|
model | string | The model to use (e.g. gpt-image-1). |
prompt | string | A text description of the desired image. |
n | integer | Number of images to generate (default: 1). |
size | string | Image dimensions (e.g. 1024x1024, 1792x1024, 1024x1792). |
quality | string | Quality level — auto, low, medium, or high. |
response_format | string | url or b64_json. |
Learn More
Generating Images
Create images from text prompts with full control over size, quality, and format.
Editing Images
Modify existing images using text prompts and optional masks.