Image Generation
GPT-Image Series
OpenAI GPT-Image generation — multi-generation lineup, multi-ratio multi-resolution, reference images and mask inpainting
POST
GPT-Image Series
OpenAI’s GPT-Image generation models, across three generations:
After submitting, poll task status with
- GPT-Image-2 — flagship new release, expanded to 13 ratios × 1K/2K/4K resolution tiers with independent billing, up to 16 reference images, with transparent background and mask inpainting support
- GPT-Image-1.5 Official — upgraded GPT-Image-1 with significantly improved visual quality and instruction following
- GPT-Image-1 Official — multimodal generation model integrating text and image understanding, suited for high-quality generation and editing
Pricing
| Model | Price (per image) |
|---|---|
gpt-image-2 | $0.006375 |
gpt-image-1.5-official | $0.09044 |
gpt-image-1-official | $0.11356 |
Mode Quick Reference
| Mode | Trigger Fields | Supported Versions |
|---|---|---|
| Text-to-image | prompt only, action: "generate" (default) | All |
| Image-to-image | + image_urls + action: "image2image" | All |
| Image editing | + image_urls + action: "edit" | All |
| Multi-image reference | + image_urls (multiple) + action: "reference" | All (up to 16) |
| Inpainting (mask) | + image_urls + mask_url + action: "inpaint" | All |
Examples
GET /v1/tasks/{task_id}. See Task System for details.
Available Models
| Model ID | Description |
|---|---|
gpt-image-2 | Flagship new release, 13 ratios × 1K/2K/4K, up to 16 reference images |
gpt-image-1.5-official | Upgraded GPT-Image-1 with significantly improved visual quality and instruction following |
gpt-image-1-official | Multimodal text + image understanding, suited for high-quality generation and editing |
Common Parameters
Pick one from the Available Models list
Operation type, allowed values:
generate— text-to-image (default)image2image— image-to-image (requiresimage_urls)edit— image editingreference— multi-image reference fusioninpaint— inpainting (requiresmask_url)
Image description text; supports both Chinese and English
Number of images to generate (multiple per call)
Random seed;
-1 means random. A fixed value reproduces similar results.Aspect ratio. Values depend on the model:
- GPT-Image-2:
auto/1:1/3:2/2:3/4:3/3:4/5:4/4:5/16:9/9:16/2:1/1:2/21:9/9:21(14 total) - GPT-Image-1.5 / 1 official:
1:1/3:2/2:3(3 only)
Output resolution. GPT-Image-2 only accepts an explicit value:
1k— 1K tier2k— 2K tier4k— 4K tier (only 6 ratios available:16:9/9:16/2:1/1:2/21:9/9:21)
Reference image URL array, up to 16; base64 inline upload also supported
Webhook callback URL, invoked when the task reaches a terminal state. See Callback Mechanism.
Callback event filter, e.g.
["completed", "failed"]Model-Specific Parameters
- GPT-Image-2
- GPT-Image-1.5 Official
- GPT-Image-1 Official
Supported actions:
generate / image2image / edit / reference / inpaintaspect_ratio (14): auto / 1:1 / 3:2 / 2:3 / 4:3 / 3:4 / 5:4 / 4:5 / 16:9 / 9:16 / 2:1 / 1:2 / 21:9 / 9:21resolution: 1k / 2k / 4k (4K limited to 16:9 / 9:16 / 2:1 / 1:2 / 21:9 / 9:21)Highlights: 13 ratios × three resolution tiers with independent billing, up to 16 reference images (URL / base64), OpenAI per-image pixel ceiling of 8.29M.Generation quality, allowed values:
auto— automatic (default)low— low qualitymedium— medium qualityhigh— high quality
Background handling, allowed values:
auto— automatic (default)opaque— opaquetransparent— transparent background (not supported on the official channel)
Mask image URL for inpainting (used with
action: "inpaint")Content moderation level, allowed values:
auto— automatic (default)low— low restriction
Output format, allowed values:
png— defaultjpegwebp
Output compression rate, range 0-100. Effective only for
jpeg / webp.Style preset
Switch to the
gpt-image-2-official channelResource Limits
| Item | Limit |
|---|---|
| Reference image count | Up to 16 (URL or base64) |
| Per-image pixel ceiling | 8.29M pixels (OpenAI’s official limit) |
| Per-image size | ≤ 30MB; supports JPG/PNG/WEBP |
| Output resolution | GPT-Image-2 up to 4K (select ratios); others use default |
| Output file | PNG (default) / JPEG / WEBP (GPT-Image-2 only); URLs valid for 24 hours |
| Transparent background | background: transparent only supported on non-official channels |
Related
- Task System Reference — task state machine / polling cadence / async push
- Request & Response — common error codes / headers / rate limits
- Authentication — API key application and usage
GPT-Image Series