模型

编辑图像

按文字描述修改一张或多张输入图像。

POST /model/v1/images/edits● 支持

官方文档 ↗

请求体

  • modelstring必填

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

    已验证生效。

  • promptstring必填

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

    已验证生效。

  • imagearray必填

    Source images as base64 data URLs.

  • maskstring可选○ 未支持

    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.

    已测 PNG mask 返回 400;当前不可用。

  • nnumber可选

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

    已验证生效。

  • sizestring可选

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

    已验证生效。

  • image[]array可选

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

    支持 multipart 文件或 JSON data URL。

返回

200

鉴权、限流、参数校验等平台错误按 problem+json 返回;OCR 的错误也为 problem+json,其它模型调用的错误按该端点所属格式(OpenAI 或 Anthropic)返回,参见 错误码

响应

HTTP 200

Edited images

application/json

名称类型说明
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`.