GPT Image 2
Generate images from text prompts using the GPT Image 2 model.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
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. Supports 1–10. Default: 1. Requires selecting the Direct group in the console.
1 <= x <= 101
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, jpeg "png"
Content moderation level.
auto, low "auto"
Compression level for jpeg format (0-100%).
0 <= x <= 10080
Response
Images generated successfully.
Array of generated images.