跳转到主要内容
POST
/
wan
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
图生视频:首帧图(+ 可选驱动音频)创建视频生成任务
curl --request POST \
  --url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-DashScope-Async: <x-dashscope-async>' \
  --data '
{
  "model": "wan2.7-i2v",
  "input": {
    "prompt": "一个由喷漆所画成的少年从墙上活过来,演唱英文 rap,夜晚铁路桥下,电影级光影",
    "media": [
      {
        "type": "first_frame",
        "url": "https://your-cdn.com/rap.png"
      },
      {
        "type": "driving_audio",
        "url": "https://your-cdn.com/rap.mp3"
      }
    ]
  }
}
'
{
  "output": {
    "task_id": "f8ca39a0-6f4b-4ec2-99bf-8b9649d946c4",
    "task_status": "PENDING"
  },
  "request_id": "..."
}

Documentation Index

Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt

Use this file to discover all available pages before exploring further.

右侧 Playground 可直接调试:在 AuthorizationBearer sk-your-api-key,填好 model / input.media / parameters 后发起请求。提交成功返回 task_id,轮询与下载见下方说明。
本页是 wan2.7-i2v(图生视频)的创建接口:给一张首帧图 + prompt,让画面动起来;可选传 driving_audio 让人像跟随音频做口型/节奏。完整异步流程见 Wan 概览
  • 音频驱动是 wan2.7-i2v 专属能力HappyHorse 的 i2v 不支持 driving_audio,做对口型 / rap 必须用 wan2.7-i2v
  • input.media 必填,否则上游报 图生视频模型 ... 必须提供图片。媒体 url 必须是公网可直接 GET 的 https 链接。
  • 创建请求走 /wan/api/v1/... 并带 X-DashScope-Async: enable,不要用 /v1/videos

代码示例

curl -X POST "https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis" \
  -H "X-DashScope-Async: enable" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan2.7-i2v",
    "input": {
      "prompt": "一个由喷漆所画成的少年从墙上活过来,演唱英文 rap,夜晚铁路桥下,电影级光影",
      "media": [
        {"type": "first_frame",   "url": "https://your-cdn.com/rap.png"},
        {"type": "driving_audio", "url": "https://your-cdn.com/rap.mp3"}
      ]
    },
    "parameters": {"resolution": "720P", "duration": 10, "prompt_extend": true, "watermark": true}
  }'

参数与媒体速查

参数类型必填默认说明
modelstring固定 wan2.7-i2v
input.promptstring文本提示词
input.mediaarray见下方媒体表
parameters.resolutionstring720P720P / 1080P
parameters.durationint52–15 秒整数
parameters.prompt_extendbooltrue智能改写,推荐开启
parameters.watermarkboolfalse「AI 生成」水印

media[] 取值

type必填张数说明
first_frame1首帧图,视频从这张图开始
driving_audio1驱动音频(wav/mp3),让人像跟随音频做口型/节奏

响应格式

{
  "output": { "task_id": "f8ca39a0-6f4b-4ec2-99bf-8b9649d946c4", "task_status": "PENDING" },
  "request_id": "..."
}
提交后 轮询 GET /v1/tasks/{task_id} 直到 completed,再从 result_url 下载 mp4(不带 Authorization,24 小时过期)。完整轮询循环见 Wan 概览 · 异步调用流程

授权

Authorization
string
header
必填

在 API易控制台获取的 API Key

请求头

X-DashScope-Async
enum<string>
默认值:enable
必填

异步处理开关,必须设置为 enable

可用选项:
enable

请求体

application/json
model
enum<string>
默认值:wan2.7-i2v
必填

模型 ID,图生视频固定 wan2.7-i2v(历史版本可填 wan2.6-i2v)

可用选项:
wan2.7-i2v,
wan2.6-i2v
input
object
必填
parameters
object

响应

任务已提交,返回 task_id 与 PENDING 状态

output
object
request_id
string

请求唯一标识

示例:

"..."