Model

Create image edit

Edit one or more input images from a text prompt.

POST /model/v1/images/edits● Supported

Official docs ↗

Request body

  • modelstring必填

    Image model id; list candidates with listModels?type=image. Router support (supported): Verified to take effect.

    Verified to take effect.

  • promptstring必填

    Text description of the desired edit. Router support (supported): Verified to take effect.

    Verified to take effect.

  • imagearray必填

    Source images as base64 data URLs.

  • maskstring可选○ Unsupported

    Mask that marks the region to edit, as a base64 data URL or multipart file. Router support (unsupported): The tested PNG mask returns 400 and is currently unusable.

    The tested PNG mask returns 400 and is currently unusable.

  • nnumber可选

    Number of edited images to generate. Router support (supported): Verified to take effect.

    Verified to take effect.

  • sizestring可选

    Size of the edited images. Router support (supported): Verified to take effect.

    Verified to take effect.

  • image[]array可选

    Source images, uploaded as multipart files. Router support (supported): Accepts multipart files or JSON data URLs.

    Accepts multipart files or JSON data URLs.

Returns

200

Platform errors (auth, rate limits, validation) and OCR errors use problem+json; other model call errors follow the endpoint's own format (OpenAI or Anthropic) — see error codes

Response

HTTP 200

Edited images

application/json

NameTypeDescription
creatednumberUnix time in seconds at which the images were created.
dataarray<object>Edited images.
data[].urlstringURL of the image; present when response_format is `url`.
data[].b64_jsonstringBase64-encoded image; present when response_format is `b64_json`.