Key capabilities
- Text-to-Image — Generate images from natural language descriptions
- Flexible resolution — Any custom size up to 4K (3840px), edges must be multiples of 16
- Near-perfect text rendering — ~99% character-level accuracy across 12+ languages
- Multi-object composition — Complex scenes without occlusion or misplacement issues
- Multi-style — Photorealism, illustration, anime, vector, 3D, data visualization
- Batch generation — Generate up to 4 images per request
Output specifications
| Property | Value |
|---|---|
| Sizes | Flexible resolution (e.g. 1024x1024, 2048x2048, 3840x2160) |
| Size constraints | Edges: multiples of 16, aspect ratio ≤ 3:1, total pixels 655,360–8,294,400 |
| Quality | low, medium, high |
| Formats | png, webp, jpeg |
Quick example
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Must be gpt-image-2 |
prompt | string | Yes | Text description of the desired image |
n | integer | No | Number of images to generate (1–4). Default: 1 |
size | string | No | {width}x{height} format. Edges must be multiples of 16, aspect ratio ≤ 3:1, total pixels 655,360–8,294,400, max edge 3,840px. Default: 1024x1024 |
quality | string | No | low, medium, high. Default: medium |
output_format | string | No | png, webp, jpeg. Default: png |
moderation | string | No | auto or low. Default: auto |
output_compression | integer | No | Compression level for jpeg/webp (0–100). |
API Reference
View the interactive API playground for GPT Image 2.