GPT Image 2
Authorizations
API Key for API endpoints
Body
The prompt for image generation
Optional input image URLs for edit mode. When provided, the model performs image editing.
Optional mask image URL to constrain the editable region in edit mode.
Aspect ratio for generated image dimensions.
1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 Resolution hint used with Aspect Ratio to derive image size.
1K, 2K, 4K Generation quality level.
low, medium, high Number of images to generate (1-4).
1 <= x <= 4Output format for generated images.
jpeg, png, webp Number of results to generate (1-4)
1 <= x <= 4Response
Generation submission accepted
Generation id.
Queue status
IN_QUEUE, IN_PROGRESS, COMPLETED, FAILED, CANCELED Normalized input payload for the generation task.
Credit usage breakdown for the request
Machine-readable generation error code. Present when status is FAILED.
Sanitized human-readable failure message. Present when status is FAILED.