POST
/
v1
/
images
/
edits
图片编辑 (OpenAI compatible)
curl --request POST \
  --url https://vip.xmsmartlink.com/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "wan2.7-image",
  "prompt": "把图2的涂鸦喷绘在图1的汽车上",
  "n": 1,
  "image": [
    "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20251229/pjeqdf/car.webp",
    "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20251229/xsunlm/paint.webp"
  ],
  "size": "1K"
}
'
{
  "data": [
    {
      "url": "https://dashscope-7c2c.oss-accelerate.aliyuncs.com/example.png",
      "b64_json": "",
      "revised_prompt": ""
    }
  ],
  "created": 1776922543,
  "metadata": {
    "output": {
      "choices": [
        {
          "finish_reason": "stop",
          "message": {
            "content": [
              {
                "image": "https://dashscope-7c2c.oss-accelerate.aliyuncs.com/example.png",
                "type": "image"
              }
            ],
            "role": "assistant"
          }
        }
      ],
      "finished": true
    },
    "usage": {
      "image_count": 1,
      "input_tokens": 34,
      "output_tokens": 2,
      "size": "1024*1024",
      "total_tokens": 36
    },
    "request_id": "b29be073-565f-9466-b2a9-1080111c8a70"
  }
}

Authorizations

Authorization
string
header
required

使用 Authorization: Bearer <YOUR_API_KEY> 进行认证。

Body

model
string
required

支持模型:wan2.7-image-pro、wan2.7-image。

prompt
string
required

编辑指令。

image
string[]
required

编辑输入图,支持 URL/Base64,支持单图或多图。

bbox_list
object[]

局部交互编辑区域列表。

n
integer

生成数量,默认为 1。

Required range: x >= 1
size
string

输出尺寸,支持 1K、2K、4K。

thinking_mode
boolean

推理模式开关。

watermark
boolean

是否添加水印。

Response

图片编辑响应。响应结构兼容 OpenAI;模型支持时会包含提供商特有 metadata。

created
integer<int64>
model
string
data
object[]
background
string
output_format
string
quality
string
size
string
usage
object

图片生成用量统计。

metadata
object

上游返回的元数据信息。