/v1/images/edits

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string | null
Defaults to auto

Allows setting transparency for the background of the generated image(s).

This parameter is only supported for openai/gpt-image-1.

Must be one of transparent, opaque or auto (default value).

When auto is used, the model will automatically determine the best background for the image.

If transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp.

image
array of files
required

The image(s) to edit. Must be a supported image file or an array of images.

For openai/gpt-image-1, each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images.

For openai/dall-e-2, you can only provide one image, and it should be a square png file less than 4MB.

file | null

An additional image whose fully transparent areas (e.g., where alpha is zero) indicate where image should be edited.

If there are multiple images provided, the mask will be applied to the first image.

Must be a valid PNG file, less than 4MB, and have the same dimensions as image.

string
required

The model to use for image generation.

int32 | null
≥ 0
Defaults to 1

The number of images to generate.

Must be between 1 and 10.

int32 | null
Defaults to 100

The compression level (0-100%) for the generated images.

This parameter is only supported for openai/gpt-image-1 with the webp or jpeg output formats, and defaults to 100.

string | null
Defaults to png

The format in which the generated images are returned.

This parameter is only supported for openai/gpt-image-1.

Must be one of png, jpeg, or webp.

The default value is png.

string
required

A text description of the desired image(s).

The maximum length is 1,000 characters for openai/dall-e-2, and 32,000 characters for openai/gpt-image-1.

string | null

The size of the generated images.

Must be one of 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto (default value) for openai/gpt-image-1,
and one of 256x256, 512x512, or 1024x1024 for openai/dall-e-2.

string | null

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json