跳转到主要内容
万相 2.7

Wan 2.7 — 查询结果

查询 Wan 2.7 图生视频任务状态

GET
/tasks/{task_id}
cURL - 查询任务结果
# 将 {task_id} 替换为提交任务时返回的实际任务 ID
curl -X GET 'https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"
{
  "request_id": "2ca1c497-f9e0-449d-9a3f-xxxxxx",
  "output": {
    "task_id": "af6efbc0-4bef-4194-8246-xxxxxx",
    "task_status": "SUCCEEDED",
    "submit_time": "2025-09-25 11:07:28.590",
    "scheduled_time": "2025-09-25 11:07:35.349",
    "end_time": "2025-09-25 11:17:11.650",
    "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
    "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
  },
  "usage": {
    "duration": 15,
    "input_video_duration": 0,
    "output_video_duration": 15,
    "video_count": 1,
    "SR": 720
  }
}
查询任务状态并获取生成的视频。

轮询策略

  1. 通过创建任务接口提交任务,保存返回的 task_id
  2. 15 秒轮询一次,直到 task_status 变为 SUCCEEDEDFAILED
  3. 任务成功后,从 video_url 下载视频。

注意事项

  • URL 有效期video_url24 小时后过期,请及时下载。
  • 状态流转PENDINGRUNNINGSUCCEEDEDFAILEDCANCELEDUNKNOWN 表示任务不存在或查询已超过 24 小时。

鉴权

string
header
必填

千问云 API Key。详见获取 API Key

路径参数

string
必填

POST 响应中返回的任务 ID。

响应

200-application/json
string

请求 ID,用于排查问题。联系支持时请提供此 ID。

2ca1c497-f9e0-449d-9a3f-xxxxxx
object
object

资源消耗信息,仅在 task_statusSUCCEEDED 时出现。