Skip to main content
POST
/
v3
/
gpt-image-2-edit
GPT Image 2 Image Edit
curl --request POST \
  --url https://api.highwayapi.ai/v3/gpt-image-2-edit \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "n": 123,
  "mask": "<string>",
  "size": "<string>",
  "image": "<string>",
  "prompt": "<string>",
  "quality": "<string>",
  "background": "<string>",
  "output_format": "<string>"
}
'
{
  "images": [
    {}
  ]
}
OpenAI GPT Image 2 image editing API. Edit images based on text prompts, with support for mask inpainting, transparent backgrounds, and multiple quality/size options.

Request Headers

Content-Type
string
required
Enum value: application/json
Authorization
string
required
Bearer authentication format: Bearer {{API Key}}.

Request Body

n
integer
default:1
Number of images to generate. The actual number returned may be less than the requested number.Valid range: [1, 10]
mask
string
Additional image whose fully transparent areas indicate where edits should be made. Must be in PNG format with an alpha channel.
size
string
default:"1024x1024"
Size of the generated image.Allowed values: auto, 688x2048, 880x2048, 1024x1024, 1024x1536, 1024x2048, 1152x2048, 1360x2048, 1536x1024, 1536x2048, 2048x688, 2048x880, 2048x1024, 2048x1152, 2048x1360, 2048x1536, 2048x2048, 2160x3840, 3840x2160
image
string
required
Image to edit. Can be a single image URL/base64 or an array of images. Supported formats: PNG, JPEG, GIF, WebP.
prompt
string
required
Text prompt describing the desired edit, with a maximum length of 32000 characters.Length limit: 0 - 32000
quality
string
default:"low"
Quality of the generated image. Higher quality takes longer and costs more.Allowed values: low, medium, high
background
string
default:"auto"
Whether the background is opaque or automatically detected.Allowed values: opaque, auto
output_format
string
default:"png"
Output image format.Allowed values: png, jpeg

Response Information

images
array
Array of generated image URLs.