Generate images from text prompts using the GPT Image 2 model.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Model ID.
gpt-image-2 "gpt-image-2"
Text description of the desired image.
"A futuristic city skyline at sunset with flying cars"
Number of images to generate.
1 <= x <= 41
Output image size in {width}x{height} format. Supports flexible resolutions — both edges must be multiples of 16, aspect ratio ≤ 3:1, total pixels between 655,360 and 8,294,400, max edge 3,840px.
"1024x1024"
Image quality.
low, medium, high "high"
Output image format.
png, webp, jpeg "png"
Content moderation level.
auto, low "auto"
Compression level for jpeg and webp formats (0-100%).
0 <= x <= 10080
Images generated successfully.
Array of generated images.