Key Capabilities
- Text-to-image — Generate images from natural language descriptions
- Image editing — Edit existing images using text prompts via
/v1/images/edits - Flexible resolution — Supports arbitrary custom dimensions up to 4K (3840px), sides must be multiples of 16
- Precise text rendering — ~99% character-level accuracy across 12+ languages
- Multi-object composition — Complex scenes without occlusion or misalignment
- Multi-style — Photorealistic, illustration, anime, vector, 3D, data visualization
For both/v1/images/generationsand/v1/images/edits,nsupports 1–10, default 1. Requires selecting the Direct group in the console.
Output Specs
Quick Example
Parameters
Image Editing
Edit existing images viaPOST /v1/images/edits. Request body uses multipart/form-data; images are uploaded as files.
Up to 16 input images per request (image[]).
Input Image Formats
Supported formats: PNG, JPEG. Images must be submitted via multipart/form-data file upload. Two available model IDs:gpt-image-2— Official modelgpt-image-2-c— Cost-effective version (supportsresponse_format)
Note: When usinggpt-image-2-c, selecting higher quality may affect stable output fornimages. For stable multi-image generation, lower quality is recommended.
Edit Endpoint Parameters
imageandimage[]are mutually exclusive and cannot be used together.
Mask Editing
Provide a mask image with an Alpha channel to control which regions of the source image are edited. Pixels where Alpha is white (opaque) are preserved; pixels where Alpha is black (transparent) will be edited. Requirements:- Mask must contain an Alpha channel
- Must match the source image in format and dimensions exactly
- File size limit: < 50MB
Mask editing and the n parameter both require selecting the Direct group in the console.
cURL
Python
Generation API Reference
Interactive Playground for
POST /v1/images/generations.Edit API Reference
Interactive Playground for
POST /v1/images/edits.
