Skip to main content

Request

Input

Input Image

Response

Image from base64 data

Output Image

Parameters

header
An optional header used for spend logging metadata, containing JSON properties like user_id, project_id, and env.
string
required
Text description of the desired edit.
file | array
required
Reference image(s) to edit. Up to 16 images supported. Must be uploaded via multipart form data — image URLs are not supported.
  • -F "image=@file.png" or -F "image[]=@file1.png" -F "image[]=@file2.png"
file | object
Alpha mask PNG. Transparent areas are regenerated; opaque areas are preserved. Must be uploaded via multipart — mask URLs are not supported.
  • -F "mask=@mask.png"
string
default:"1024x1024"
Output image dimensions. Supports arbitrary WIDTHxHEIGHT where both edges are multiples of 16, aspect ratio between 1:3 and 3:1, max edge 3840.Standard values: 1024x1024, 1536x1024, 1024x1536, auto.Supported values depend on the selected model. See the OpenAI image generation guide for the latest model-specific ranges.
string
default:"auto"
Allowed values: low, medium, high, auto
integer
default:"1"
Number of edited images to return.
string
default:"png"
Allowed values: png, jpeg
webp is not supported on Azure gpt-image-2.
integer
Compression level (0–100). Only applies when output_format is jpeg.
string
default:"auto"
Allowed values: auto, low
boolean
default:"false"
Stream partial edit results.
integer
Number of partial images during streaming (0–3). Only used when stream is true.

Params to Avoid