Skip to main content
POST
GPT-Image Series
OpenAI’s GPT-Image generation models, across three generations:
  • 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
Per-image billing. Supports text-to-image / image-to-image / editing / mask inpainting / multi-image reference.

Pricing

Mode Quick Reference

Examples

After submitting, poll task status with 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 (requires image_urls)
  • edit — image editing
  • reference — multi-image reference fusion
  • inpaint — inpainting (requires mask_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 tier
  • 2k — 2K tier
  • 4k — 4K tier (only 6 ratios available: 16:9 / 9:16 / 2:1 / 1:2 / 21:9 / 9:21)
GPT-Image-1.5 / 1 official does not accept this field and uses the model default.
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

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 quality
  • medium — medium quality
  • high — high quality
string
default:"auto"
Background handling, allowed values:
  • auto — automatic (default)
  • opaque — opaque
  • transparent — 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 — default
  • jpeg
  • webp
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 channel

Resource Limits