Skip to main content
Use this exact public ID:

Output controls

The official gpt-image-2 model accepts additional resolutions that meet the constraints in OpenAI’s image generation guide. This API exposes the three presets above for Generate, Async Generate, and Edit. Set size explicitly when exact pixels matter; omitted-size behavior is outside this public API.

Generate request

Send this body to /v1/images/generations for synchronous generation.

Unified asynchronous body

Send JSON to /v1/images/tasks. Use action=generate without input_images, or action=edit with 1–16 Base64 images:
Each decoded source must not exceed 20 MiB and all sources together must remain within 64 MiB. mime_type must match the actual PNG, JPEG, or WebP bytes. GPT Image tasks omit aspect_ratio. Use Idempotency-Key for retryable submissions.

Edit form

Send multipart/form-data to /v1/images/edits with:
  • model=gpt-image-2-vip;
  • one image file;
  • a required prompt;
  • one supported size and quality;
  • n=1 or an omitted n.
Synchronous multipart Edit does not publish one fixed source-image byte or pixel limit. If the gateway returns HTTP 413, reduce the image and total multipart body before retrying; the unified JSON task limit remains 20 MiB decoded. See errors and safe retries.

Quality behavior

low uses a smaller output budget than medium; high uses the largest supported budget; auto lets the route choose. Request duration varies independently, so do not select quality as a timeout control. An invalid value fails with HTTP 400:
The reverse-image contract returns one result and excludes masks, streaming, output-format controls, transparency, callbacks, cancellation, and SDK-specific behavior. Completed tasks preserve native ImagesResponse and retain the image for 24 hours.

Copy VIP examples

Run all three supported workflows.
Last modified on September 3, 2026