APIMPAPIMP
用户指南AI 接口图片接口视频接口公共接口

wan2.7

提交 Alibaba Wan 2.7 异步视频生成任务。单一模型 ID wan2.7,模式(text-to-video / image-to-video / video-continuation)由请求中的 image / images / image_with_roles / video_urls 自动判定。返回 task_id 后通过状态查询接口轮询直到 status=finished

POST
/api/generate/submit

Authorization

BearerAuth

AuthorizationBearer <token>

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

In: header

Request Body

application/json

model*string

固定值 wan2.7。模式(text / image / video-continuation)由请求中的媒体输入自动判定。

Value in"wan2.7"
prompt?string

视频描述,最多 5000 字符。Text-to-Video 必填;带媒体输入(image / images / image_with_roles / video_urls)时可省。

size?string

视频比例,默认 16:9

Value in"16:9" | "9:16" | "1:1" | "4:3" | "3:4"
duration?integer

视频时长,单位为秒。范围 2..15,默认 5。

Range2 <= value <= 15
images?array<string>

参考图 URL 列表,1~2 张。2 张时第 1 张为首帧、第 2 张为尾帧。与 image_with_roles 互斥。

Itemsitems <= 2
resolution?string

视频清晰度,默认 1080P

Value in"720P" | "1080P"
negative_prompt?string

不希望出现的内容描述,最多 500 字符。

audio_url?string

背景 / 驱动音频 URL,格式 wav / mp3,时长 2~30 秒,大小 ≤15MB。

prompt_extend?boolean

是否启用智能提示词改写,默认 true

watermark?boolean

是否给生成视频打上 "AI Generated" 水印,默认 false

seed?integer

随机种子,≥0,用于复现。

Range0 <= value
image_with_roles?array<object>

带角色的参考图列表,与 images 互斥。

Array Item (object)
url*string
role*string
Value in"first_frame" | "last_frame"
video_urls?array<string>

视频续帧使用的输入视频 URL,只支持 1 个。

Itemsitems <= 1
callback_url?string

任务终态时由平台主动 POST 的 HTTPS 回调地址(可选)。

Formaturi
[key: string]?never

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.apimp.ai/api/generate/submit" \  -H "Content-Type: application/json" \  -d '{    "model": "wan2.7",    "prompt": "A samurai cat walking through neon Tokyo, cinematic lighting"  }'
{
  "code": 200,
  "data": {
    "task_id": "task_2BvCWmHzG6sJxK4tQpAr8M9nZyYfRdLs",
    "status": "not_started",
    "created_time": "2026-06-27T09:21:26",
    "error_message": null
  }
}

{
  "code": 400,
  "error": {
    "message": "prompt is required unless `image`, `images`, `image_with_roles`, or `video_urls` is provided",
    "type": "invalid_request_error"
  }
}

{
  "code": 400,
  "error": {
    "message": "string",
    "type": "invalid_request_error"
  }
}
{
  "code": 400,
  "error": {
    "message": "string",
    "type": "invalid_request_error"
  }
}
{
  "code": 400,
  "error": {
    "message": "string",
    "type": "invalid_request_error"
  }
}
{
  "code": 400,
  "error": {
    "message": "string",
    "type": "invalid_request_error"
  }
}

这篇文档对您有帮助吗?

最后更新于