> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 全能参考生视频

> 参考图、参考视频、参考音频自由组合，在提示词里按序号指代。

最多 10 张 `reference_image`、5 段 `reference_video`、5 段 `reference_audio` 自由组合。提示词里按传入顺序用「图1」「视频1」「音频1」指代素材，例如人物参考图 1、场景参考视频 1、声音参考音频 1。参考视频的时长计入计费时长。

> [!TIP]
>
> 想直接调试？打开 [创建视频生成任务](https://docs.dreamto.ai/api-reference/wan-3-0/create-video-synthesis.md)，在请求示例下拉框中选择「全能参考（图 + 视频 + 音频）」，填入 API Key 后点击 **Try it**。

## 请求示例

示例中的 `$DREAMTO_API_KEY` 为你的 API Key。

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/api/v1/services/aigc/video-generation/video-synthesis" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-DashScope-Async: enable" \
  -d '{
    "model": "wan3.0-video",
    "input": {
      "prompt": "图1中的人物站在视频1的场景里，用音频1的声音说：欢迎来到未来。",
      "media": [
        {
          "type": "reference_image",
          "url": "https://your-cdn.example.com/person.png"
        },
        {
          "type": "reference_video",
          "url": "https://your-cdn.example.com/scene.mp4"
        },
        {
          "type": "reference_audio",
          "url": "https://your-cdn.example.com/voice.mp3"
        }
      ]
    },
    "parameters": {
      "resolution": "1080P",
      "ratio": "16:9",
      "duration": 8
    }
  }'
```

```python Python theme={null}
import os
import requests

payload = {
    "model": "wan3.0-video",
    "input": {
        "prompt": "图1中的人物站在视频1的场景里，用音频1的声音说：欢迎来到未来。",
        "media": [
            {
                "type": "reference_image",
                "url": "https://your-cdn.example.com/person.png"
            },
            {
                "type": "reference_video",
                "url": "https://your-cdn.example.com/scene.mp4"
            },
            {
                "type": "reference_audio",
                "url": "https://your-cdn.example.com/voice.mp3"
            }
        ]
    },
    "parameters": {
        "resolution": "1080P",
        "ratio": "16:9",
        "duration": 8
    }
}

resp = requests.post(
    "https://api.dreamto.ai/api/v1/services/aigc/video-generation/video-synthesis",
    headers={
        "Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}",
        "X-DashScope-Async": "enable",
    },
    json=payload,
    timeout=60,
)
print(resp.status_code, resp.json())  # {'request_id': '...', 'output': {'task_id': '...', 'task_status': 'PENDING'}}
```

```javascript Node.js theme={null}
const payload = {
  "model": "wan3.0-video",
  "input": {
    "prompt": "图1中的人物站在视频1的场景里，用音频1的声音说：欢迎来到未来。",
    "media": [
      {
        "type": "reference_image",
        "url": "https://your-cdn.example.com/person.png"
      },
      {
        "type": "reference_video",
        "url": "https://your-cdn.example.com/scene.mp4"
      },
      {
        "type": "reference_audio",
        "url": "https://your-cdn.example.com/voice.mp3"
      }
    ]
  },
  "parameters": {
    "resolution": "1080P",
    "ratio": "16:9",
    "duration": 8
  }
};

const resp = await fetch("https://api.dreamto.ai/api/v1/services/aigc/video-generation/video-synthesis", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.DREAMTO_API_KEY}`,
    "Content-Type": "application/json",
    "X-DashScope-Async": "enable",
  },
  body: JSON.stringify(payload),
});
console.log(resp.status, await resp.json()); // { request_id: '...', output: { task_id: '...', task_status: 'PENDING' } }
```

## 响应

创建成功返回 HTTP 200，任务进入排队。`request_id` 排查问题时请提供：

```json theme={null}
{
  "request_id": "7d2c3a51-8f0e-4b6a-9c1d-2e3f4a5b6c7d",
  "output": {
    "task_id": "0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f",
    "task_status": "PENDING"
  }
}
```

拿到 `output.task_id` 后，每 15 秒左右调用 [查询任务](https://docs.dreamto.ai/api-reference/wan-3-0/query-task.md)，`task_status` 为 `SUCCEEDED` 时从 `output.video_url` 下载视频。全部请求参数与取值说明见 [创建视频生成任务](https://docs.dreamto.ai/api-reference/wan-3-0/create-video-synthesis.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.