编辑图像
按文字描述修改一张或多张输入图像。
/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
| 名称 | 类型 | 说明 |
|---|---|---|
| created | number | Unix time in seconds at which the images were created. |
| data | array<object> | Edited images. |
| data[].url | string | URL of the image; present when response_format is `url`. |
| data[].b64_json | string | Base64-encoded image; present when response_format is `b64_json`. |