POST
/
images
/
edits
Edit images based on a prompt
curl --request POST \
  --url https://{controlPlaneURL}/api/llm/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'model=<string>' \
  --form 'image=<string>' \
  --form 'prompt=<string>' \
  --form 'background=<string>' \
  --form 'input_fidelity=<string>' \
  --form 'mask=<string>' \
  --form n=123 \
  --form output_compression=123 \
  --form 'output_format=<string>' \
  --form partial_images=123 \
  --form 'quality=<string>' \
  --form 'response_format=<string>' \
  --form 'size=<string>' \
  --form stream=true \
  --form 'user=<string>'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Body

multipart/form-data
model
string
required

The model to use for image generation.

image
required

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

prompt
string
required

A text description of the desired image(s).

background
string | null

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

input_fidelity
string | null

Control how much effort the model will exert to match the style and features of input images.

mask
string

An additional image whose fully transparent areas indicate where image should be edited.

n
integer | null

The number of images to generate. Must be between 1 and 10.

output_compression
integer | null

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

output_format
string | null

The format in which the generated images are returned.

partial_images
integer | null

The number of partial images to generate. Used for streaming responses.

quality
string | null

The quality of the image that will be generated.

response_format
string | null

The format in which generated images are returned. Must be one of url or b64_json.

size
string | null

The size of the generated images.

stream
boolean | null

Edit the image in streaming mode.

user
string

A unique identifier representing your end-user.

Response

Successfully edited images

created
number
required
data
object[]
required