> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jiekou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT Image 2 Image Edit

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

<ParamField header="Content-Type" type="string" required={true}>
  Enum value: `application/json`
</ParamField>

<ParamField header="Authorization" type="string" required={true}>
  Bearer authentication format: Bearer \{\{API Key}}.
</ParamField>

## Request Body

<ParamField body="n" type="integer" default={1}>
  Number of images to generate. The actual number returned may be less than the requested number.

  Valid range: \[1, 10]
</ParamField>

<ParamField body="mask" type="string">
  Additional image whose fully transparent areas indicate where edits should be made. Must be in PNG format with an alpha channel.
</ParamField>

<ParamField body="size" type="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`
</ParamField>

<ParamField body="image" type="string" required={true}>
  Image to edit. Can be a single image URL/base64 or an array of images. Supported formats: PNG, JPEG, GIF, WebP.
</ParamField>

<ParamField body="prompt" type="string" required={true}>
  Text prompt describing the desired edit, with a maximum length of 32000 characters.

  Length limit: 0 - 32000
</ParamField>

<ParamField body="quality" type="string" default="low">
  Quality of the generated image. Higher quality takes longer and costs more.

  Allowed values: `low`, `medium`, `high`
</ParamField>

<ParamField body="background" type="string" default="auto">
  Whether the background is opaque or automatically detected.

  Allowed values: `opaque`, `auto`
</ParamField>

<ParamField body="output_format" type="string" default="png">
  Output image format.

  Allowed values: `png`, `jpeg`
</ParamField>

## Response Information

<ResponseField name="images" type="string[]" required={false}>
  Array of generated image URLs.
</ResponseField>
