POST
/
v1
/
images
/
generations
生成/编辑图像
curl --request POST \
  --url https://api.example.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "wan2.7-image-pro",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "image": "https://img.alicdn.com/imgextra/i3/O1CN0157XGE51l6iL9441yX_!!6000000004770-49-tps-1104-1472.webp"
          },
          {
            "image": "https://img.alicdn.com/imgextra/i3/O1CN01SfG4J41UYn9WNt4X1_!!6000000002530-49-tps-1696-960.webp"
          },
          {
            "text": "把图1的闹钟放在图2的框选的位置,保持场景和光线融合自然"
          }
        ]
      }
    ]
  },
  "parameters": {
    "bbox_list": [
      [],
      [
        [
          989,
          515,
          1138,
          681
        ]
      ]
    ],
    "size": "2K",
    "n": 1,
    "watermark": false
  }
}
'
{
  "output": {
    "choices": [
      {
        "finish_reason": "stop",
        "message": {
          "content": [
            {
              "image": "https://dashscope-xxx.oss-xxx.aliyuncs.com/xxx.png?Expires=xxx",
              "type": "image"
            }
          ],
          "role": "assistant"
        }
      }
    ],
    "finished": true
  },
  "usage": {
    "image_count": 1,
    "input_tokens": 10867,
    "output_tokens": 2,
    "size": "1488*704",
    "total_tokens": 10869
  },
  "request_id": "71dfc3c6-f796-9972-97e4-bc4efc4faxxx"
}

Authorizations

Authorization
string
header
required

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

Body

application/json
model
string
required

可选值:wan2.7-image-pro、wan2.7-image。

input
输入的基本信息 · object
required
parameters
模型参数配置 · object

Response

200 - application/json

成功生成图像

output
模型生成的输出内容 · object
required
usage
输出信息统计 · object
required
request_id
string
required