Skip to main content
GPT Image 2 is OpenAI’s image generation and editing model. AnyFast exposes the public model ID gpt-image-2 through two Image API endpoints:
  • POST /v1/images/generations creates images from text.
  • POST /v1/images/edits edits one or more uploaded images, with an optional mask.
Select the Direct resource group when using gpt-image-2. GPT Image models return Base64-encoded image data in data[].b64_json; do not send the DALL·E-only response_format parameter.

Key capabilities

Capability guide

The images below come from OpenAI’s shared image generation guide, which currently illustrates GPT Image 2.5. They show generation and editing workflows; requests on this page still use gpt-image-2.
Describe the desired subject, composition, lighting, style, and text in prompt. The model supports low, medium, high, and auto quality settings and can return from one through ten images.Square images are typically fastest. Use a custom size when the final layout matters, but keep both edges divisible by 16.
A beige coffee mug on a wooden table in OpenAI's image generation guide

Coffee mug — OpenAI guide example

A river made of white owl feathers in a winter landscape

Feather river — OpenAI guide final image

The feather-river prompt combines a subject, material, and setting: a river made of white owl feathers, winding through a winter landscape. Only the final image is shown here.

Request examples

cURL

Output controls

Custom size rules

Custom WIDTHxHEIGHT dimensions must satisfy all of these rules:
  • Width and height are multiples of 16 pixels.
  • The aspect ratio is between 1:3 and 3:1.
  • Neither edge exceeds 3,840 pixels.
  • Total pixels are between 655,360 and 8,294,400.
  • Resolutions above 2560x1440 are experimental.

Image editing inputs

  • Upload one image with image, or as many as 16 images with image[]; do not send both forms in one request.
  • Use PNG or JPEG source files through multipart form uploads.
  • Each source image and optional mask must be smaller than 50 MB.
  • GPT Image 2 always processes edit inputs at high fidelity, so the request must omit input_fidelity.

Response handling

The AnyFast response contains created, model, data, and token usage. Decode data[0].b64_json and save it with the extension selected by output_format.
Decode the first result
For transparent output, save the Base64 data with a .png or .webp extension that matches output_format. The workflow images above are embedded from OpenAI’s API guide. For GPT Image 2-specific examples of text-heavy layouts, multilingual text, flexible aspect ratios, and controlled edits, see the launch gallery below.

Explore the GPT Image 2.0 launch gallery

View OpenAI’s official GPT Image 2.0 generation and editing showcase.

Limitations

  • Complex prompts can take up to two minutes to process.
  • Precise text placement and clarity can still require iteration.
  • Recurring characters and brand elements can vary across separate generations.
  • The model may struggle with exact composition control in highly structured layouts.
Looking for a lower-cost AnyFast variant with response_format support? See gpt-image-2-c. It does not support the n parameter.
See the OpenAI GPT Image 2 model page, image generation guide, create image reference, and create image edit reference for the upstream specification.

GPT Image 2 API Reference

View generation and editing request fields and response schemas.