Generate image
generate_imageGenerate images from English text prompts and save originals locally while returning downscaled previews and file paths; supports PNG, JPEG, WebP, and animated GIF output.
Instructions
Generate images from a text prompt and save them to local files. Returns downscaled previews and the paths of the originals. Supports raster output and animated GIF. If the result has status "running", call get_image_result with its job_id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images, at most 4. | |
| size | No | "auto" or WIDTHxHEIGHT, such as 1024x1024, 1536x1024 or 1024x1536. Custom sizes use multiples of 16 and an aspect ratio from 1:3 to 3:1. | |
| model | No | gpt-image-2.6-flare is the default and suits fast iteration. gpt-image-2.6-sunburst suits work with demanding requirements for detail, layout or edit accuracy. | |
| prompt | Yes | Description of the desired image or edit. Must be written in English. Keep text that should appear in the image in its original language, in quotes. | |
| quality | No | Rendering quality. Use low for drafts. Compare medium and high for small text or dense information. | |
| workspace | No | Your current working directory. Only its last segment is used, to name the folder that groups saved images. Omit it if you do not know the directory; never guess. | |
| background | No | Transparent cannot be used with output_format jpeg. | |
| complexity | No | How much the model plans before rendering. Defaults to high, which suits dense text and layouts but takes longer. Start with low for targeted edits. | |
| moderation | No | ||
| frame_count | No | GIF only. Number of frames. | |
| output_format | No | Defaults to png. Access to gif can depend on the account. | |
| frame_duration_ms | No | GIF only. Delay per frame in milliseconds. | |
| output_compression | No | Compression level for jpeg or webp output. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| next | No | ||
| error | No | ||
| usage | No | ||
| images | No | ||
| job_id | No | ||
| status | Yes | ||
| elapsed_seconds | No | ||
| revised_prompts | No |