{
"created": 1700000000,
"data": [
{
"url": "https://cdn.example.com/image.png"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}编辑图片
请求格式、响应与能力边界。
{
"created": 1700000000,
"data": [
{
"url": "https://cdn.example.com/image.png"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}POST /v1/images/edits
推荐从 multipart 文件上传开始:model、prompt、image,可选 mask。SDK/cURL 自动生成 boundary;支持多图时可使用渠道要求的重复 image[]。
JSON 请求表描述 images[].image_url 形式,仅适用于支持该形式的渠道;其他插件的字段可能不同。蒙版、参考图数量、格式和大小需按模型确认。项目通用 Files API 未实现,不提供统一 file_id 上传流程。
完整接入指南与可执行示例
Read in English授权
模型调用 API Key,不是控制台登录凭据 / Model API key, not console login credentials
请求体
当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint
"YOUR_MODEL_ID"
任务描述;遵循模型的长度和内容要求 / Task description; follow model length and content requirements
输入图片文件;重复 image[] 的支持取决于渠道 / Input image file; repeated image[] support depends on the channel
请求图片数,模型通常有更小限制;建议从 1 开始 / Requested image count; models usually impose a smaller limit; start with 1
1 <= x <= 128模型支持的尺寸,使用 x 而不是 × / Model-supported size; use x rather than ×
质量档位,由模型决定 / Quality setting determined by the model
url 或 b64_json,仅在模型支持时指定;有些模型固定返回 Base64 / url or b64_json when supported; some models always return Base64
输出编码,例如 png、jpeg、webp;需模型支持 / Output encoding such as png, jpeg, webp; requires model support
背景选项;透明背景需模型和编码支持 / Background option; transparency requires model and format support
可选蒙版;格式、尺寸与透明区域语义由模型决定 / Optional mask; format, dimensions, and transparent-area semantics depend on the model