Skip to main content
GPT Image 2 is OpenAI’s next-generation image generation model, available through AnyFast API. Built on an autoregressive + reasoning hybrid architecture, it delivers native 2K resolution, near-perfect text rendering (~99% character-level accuracy across 12+ languages), and superior multi-object scene composition.

Key capabilities

  • Text-to-Image — Generate images from natural language descriptions
  • Image editing — Edit an existing image with a text prompt via /v1/images/edits
  • 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
Both /v1/images/generations and /v1/images/edits support n=1–10 (default 1). Requires selecting the Direct group in the console.

Output specifications

Quick example

Parameters

Image editing

Edit an existing image with a text prompt via POST /v1/images/edits. Use multipart/form-data and pass images as file uploads. Supports up to 16 input images per request (image[]).

Input image formats

Supported formats: PNG, JPEG. Images must be provided as multipart/form-data file uploads.
Looking for a lower-cost option with response_format support (no n parameter)? See gpt-image-2-c.

Edit parameters

Use either image (single file) or image[] (array) — not both.

Mask editing

Provide a mask image with an alpha channel to control which areas of the source image to edit. Pixels with white (opaque) alpha are preserved; pixels with black (transparent) alpha are edited. Requirements:
  • The mask must contain an Alpha channel
  • Must be the same image format and same dimensions as the source image
  • File size limit: < 50MB
Both mask editing and the n parameter require selecting the Direct group in the console.
cURL
If your mask is a black-and-white image without an alpha channel, convert it first:
Python

Generate API Reference

Interactive playground for POST /v1/images/generations.

Edit API Reference

Interactive playground for POST /v1/images/edits.