图像编辑
基于提示词对已有图片进行编辑或局部修改,兼容 OpenAI Images Edits 接口。
基本信息
方法POST
端点https://koprouter.kopglobal.com/v1/images/edits
鉴权Authorization: Bearer sk-...
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model |
string | 是 | 图像编辑模型 ID |
image |
file | 是 | 待编辑的原始图片 |
prompt |
string | 是 | 描述编辑目标的文字 |
mask |
file | 否 | 蒙版图,用于限定编辑区域 |
size |
string | 否 | 输出尺寸 |
请求示例
curl https://koprouter.kopglobal.com/v1/images/edits \
-H "Authorization: Bearer sk-..." \
-F "model=MODEL_ID" \
-F "image=@input.png" \
-F "prompt=Make the sky orange"
响应示例
{
"created": 1720000000,
"data": [
{
"url": "https://example.com/edited.png"
}
]
}