Skip to main content
POST
Image editing

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
images
object[]
required

Required source images. Supported counts depend on the selected model.

Required array length: 1 - 16 elements
prompt
string
required

Required. Describe the image to generate.

Minimum string length: 1
model
string
required

Required. Use a model ID or available alias returned by Get Models.

Minimum string length: 1
Examples:

"gpt-image-2.5-sunburst"

"gpt-image-2.5-sunburst-2026-09-08"

"gpt-image-2.5-flare"

"gpt-image-2.5-flare-2026-09-08"

"gpt-image-2"

"gpt-image-2-2026-04-21"

"gpt-image-1.5"

"gpt-image-1"

"gpt-image-1-mini"

"chatgpt-image-latest"

"dall-e-2"

background
enum<string> | null

Output background, only supported by GPT Image model. When transparent, output_format must be png or webp.

Available options:
transparent,
opaque,
auto,
null
input_fidelity
enum<string> | null

The degree of consistency with the original input image, only supported GPT Image models apply.

Available options:
high,
low,
null
mask
object

Mask used for local redrawing. Choose one of file_id and image_url.

moderation
enum<string> | null

Content moderation level, only supported by the GPT Image model.

Available options:
low,
auto,
null
n
integer | null

Number of generated images. Allowed counts depend on the selected model.

Required range: 1 <= x <= 10
output_compression
integer | null

Compression ratio (0–100) for jpeg or webp output, supported only by GPT Image model.

Required range: 0 <= x <= 100
output_format
enum<string> | null

Output image format, only supported by GPT Image model.

Available options:
png,
jpeg,
webp,
null
partial_images
integer | null

The number of intermediate graphs generated in the streaming response.

Required range: 0 <= x <= 3
quality
enum<string> | null

Output quality. Supported values depend on the selected model.

Available options:
low,
medium,
high,
xhigh,
max,
auto,
null
size
string

Output size as WIDTHxHEIGHT, or auto for the model default. Supported sizes depend on the selected model.

Pattern: ^(auto|[1-9][0-9]*x[1-9][0-9]*)$
stream
boolean | null

Whether to return intermediate and final results as an SSE event stream.

user
string

A unique identifier for the end user, used for abuse monitoring and detection.

response_format
enum<string>
default:url

Response format: url returns image URLs; b64_json returns Base64 image data.

Available options:
b64_json,
url

Response

200 - application/json
created
integer
required

The Unix timestamp in seconds when the edit result was created.

data
object[]
required

Edited image list.

background
enum<string>

The actual output context used.

Available options:
transparent,
opaque
output_format
enum<string>

Actual output format.

Available options:
png,
webp,
jpeg
quality
enum<string>

Output quality for actual use.

Available options:
low,
medium,
high,
auto
size
string

The actual generated image size.

usage
object

The token usage of the GPT Image model.