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
Mode Quick Reference
Examples
GET /v1/tasks/{task_id}. See Task System for details.
Available Models
Common Parameters
string
required
Pick one from the Available Models list
string
default:"generate"
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)
string
required
Image description text; supports both Chinese and English
integer
default:"1"
Number of images to generate (multiple per call)
integer
default:"-1"
Random seed;
-1 means random. A fixed value reproduces similar results.string
default:"1:1"
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)
string
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)
string[]
Reference image URL array, up to 16; base64 inline upload also supported
string
Webhook callback URL, invoked when the task reaches a terminal state. See Callback Mechanism.
string[]
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.string
default:"auto"
Generation quality, allowed values:
auto— automatic (default)low— low qualitymedium— medium qualityhigh— high quality
string
default:"auto"
Background handling, allowed values:
auto— automatic (default)opaque— opaquetransparent— transparent background (not supported on the official channel)
string
Mask image URL for inpainting (used with
action: "inpaint")string
default:"auto"
Content moderation level, allowed values:
auto— automatic (default)low— low restriction
string
default:"png"
Output format, allowed values:
png— defaultjpegwebp
integer
Output compression rate, range 0-100. Effective only for
jpeg / webp.string
Style preset
boolean
default:"false"
Switch to the
gpt-image-2-official channelResource Limits
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