Skip to main content
POST
/
v1
/
image
/
edits

Authorization

  • Auth Type: Bearer Auth (In: header)
  • Format: Authorization: Bearer <YOUR_API_KEY>
  • Description: Use Bearer <YOUR_API_KEY>. Format: Authorization: Bearer sk-xxxxxx.
  • API Key: where API Key is your AGCloud API KEY

Request Parameters

FieldTypeRequiredDefaultDescription
modelstring-The model identifier to use for this request, e.g. git-image-2.
promptstring-A text description of the desired image edit.
imagefile-The input image(s) to edit. Each image should be a png, webp, or jpg file. You can provide up to 16 images.
maskfile--An additional image whose fully transparent areas indicate where the image should be edited.
input_fidelityfile--Controls how faithfully the model preserves the original input image. Only supported by gpt-image-1. gpt-image-2 always uses high fidelity.
ninteger-1The number of images to generate. Must be between 1 and 10.
sizestring-autoThe size of the generated images. For gpt-image-1: one of auto, 1024x1024, 1536x1024, or 1024x1536. For gpt-image-2: supports arbitrary resolutions (max edge ≤ 3840px, both sides must be multiples of 16px, aspect ratio ≤ 3:1, total pixels between 655,360 and 8,294,400).
qualitystring-autoThe quality of the generated images. One of auto, low, medium, or high. Defaults to auto. Not supported by -plus suffixed models.
backgroundstring-autoAllows to set transparency for the background of the generated image(s). transparent is only supported by gpt-image-1 (not gpt-image-2) and requires output_format to be png or webp.
moderationstring-autoContent moderation level for generated images. low is less restrictive, auto is the default.
output_formatstring-autoThe output format of the generated image(s). Defaults to auto. jpeg is faster than png for latency-sensitive scenarios.
output_compressionstring-100The compression level (0-100%) for the output image. Only applicable with webp or jpeg format. Defaults to 100.
streamstring-falseWhether to stream the response in real-time. When enabled, partial images can be received during generation.
partial_imagesstring--The number of partial images to receive during streaming. Only used when stream is true. Set to 0 for a single streaming event with the complete image. Each partial image incurs an additional 100 image output tokens.
userstring--A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.