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

# 视频生成

视频生成的接入顺序很简单：先请求模型列表，选择一个可用模型，再调用生成接口创建任务。

<Info>
  如果你还没有 API Key，请先阅读 [获取 API KEY 教程](/zh/use/api-key)。
</Info>

<Info>
  查看视频生成模型价格：[中文站](https://aitoearn.cn/zh-CN/pricing#pricing-table-video-gen) / [国际站](https://aitoearn.ai/zh-CN/pricing#pricing-table-video-gen)。
</Info>

## 接入顺序

1. 调用 [视频生成模型](/api-reference/get-api-ai-models-video-generation)，读取当前站点可用的视频模型。
2. 从模型列表的 `data[n].name` 复制模型名称，后续作为 `model` 传给生成接口。
3. 根据同一个模型项里的 `resolutions`、`aspectRatios`、`durations`、`modes` 和 `inputConstraints` 选择分辨率、比例、时长和参考素材。
4. 调用 [生成视频](/api-reference/post-api-ai-video-generations)，传入 `model`、`prompt` 和可选参数。
5. 生成接口会返回 `data.id`，用它调用 [视频任务状态](/api-reference/get-api-ai-video-generations-task-id) 查询结果。

如果需要上传参考图、参考视频或参考音频，请先用 [资源上传](../asset-upload) 获取公网可访问 URL，再写入生成接口对应的参考素材字段。

如果需要使用已授权的真人形象，请先完成 [真人素材](../real-person-assets) 流程。真人素材状态变为 `Active` 后，在 `images`、`videos` 或 `audios` 中传入 `asset://{assetId}`。

## 模型列表与 modes

`GET /api/ai/models/video/generation` 返回当前可用视频模型。生成任务时不要硬编码模型参数，`model` 使用模型项里的 `name`，`mode`、`resolution`、`ratio` 和 `duration` 从同一个模型项的可用值里选择。

## modes 常量说明

同一个模型可能只支持其中一部分模式。调用生成接口时，`mode` 只能使用当前模型 `modes` 数组里出现的值。

| mode | 含义 | 典型输入参数 |
| - | - | - |
| `text2video` | 文生视频 | `prompt` |
| `image2video` | 单图生视频 | `prompt` + `image`，或只有 1 项的 `images` |
| `flf2video` | 首尾帧生视频 | `prompt` + 首帧图片 + `image_tail` |
| `lf2video` | 预留常量 | 当前线上模型列表未返回该模式，不建议主动传入 |
| `multi-image2video` | 多图参考生视频 | `prompt` + 多项 `images` |
| `multi-ref` | 多模态参考生视频 | `prompt` + `images` / `videos` / `audios` |
| `video2video` | 视频到视频或视频编辑 | `prompt` + `video_url`，或 `videos` |

如果不传 `mode`，后端会根据输入素材推导模式；API 集成建议显式传入 `mode`，便于在请求前校验模型是否支持当前输入形态。价格以价格页、模型列表接口返回的 `pricing` 和生成接口返回的 `data.points` 为准。

## 最小请求

先请求模型列表：

```bash theme={null}
curl --request GET 'https://aitoearn.cn/api/ai/models/video/generation' \
  --header 'X-Api-Key: <API_KEY>'
```

再创建视频生成任务：

```bash theme={null}
curl --request POST 'https://aitoearn.cn/api/ai/video/generations' \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <API_KEY>' \
  --data '{
    "model": "从 data[n].name 复制",
    "prompt": "生成一段城市夜景航拍视频",
    "resolution": "720p",
    "ratio": "16:9",
    "duration": 5
  }'
```

## 查询结果

```bash theme={null}
curl --request GET 'https://aitoearn.cn/api/ai/video/generations/{taskId}' \
  --header 'X-Api-Key: <API_KEY>'
```

其中 `{taskId}` 填生成接口返回的 `data.id`。任务完成后，结果里会返回 `data.videoUrl` 和 `data.coverUrl`。如果需要查看历史任务，可以调用 [视频任务列表](/api-reference/get-api-ai-video-generations)。

## 当前模型支持情况

<Info>更新于 2026/07/26 11:51:21（北京时间）。</Info>

| 模型 | 支持的模式 | 支持的分辨率 | 支持的时长 | 图片输入数量 | 音频输入数量 | 视频输入数量 | 支持比例 |
| - | - | - | - | - | - | - | - |
| Seedance 2.0 Fast Beta<br />`seedance-2-fast-beta` | text2video、image2video、multi-image2video、multi-ref | 480p、720p | 4-15 秒 | 9 | 3 | 3 | 21:9、16:9、4:3、1:1、3:4、9:16 |
| Seedance 2.0 Beta<br />`seedance-2-beta` | text2video、image2video、multi-image2video、multi-ref | 720p | 4-15 秒 | 9 | 3 | 3 | 21:9、16:9、4:3、1:1、3:4、9:16 |
| Seedance 2.0 Beta 1080p<br />`seedance-2-beta-1080p` | text2video、image2video、multi-image2video、multi-ref | 1080p | 4-15 秒 | 9 | 3 | 3 | 16:9、9:16、1:1 |
| Seedance 2.0 Beta Mini<br />`seedance-2.0-beta-mini` | text2video、image2video、multi-image2video、multi-ref | 720p | 4-15 秒 | 9 | 3 | 3 | 16:9、9:16、1:1、4:3、3:4、21:9 |
| HappyHorse 1.1<br />`happyhorse-1.1` | text2video、image2video、multi-image2video、video2video | 720P、1080P | 3-15 秒 | 9 | 0 | 1 | 16:9、9:16、1:1、4:3、3:4 |
| Seedance 2.0<br />`doubao-seedance-2-0-260128` | text2video、image2video、flf2video、multi-image2video、multi-ref | 720p、1080p、4k | 4-15 秒 | 9 | 3 | 3 | 16:9、4:3、1:1、3:4、9:16、21:9 |
| Seedance 2.0 Fast<br />`doubao-seedance-2-0-fast-260128` | text2video、image2video、flf2video、multi-image2video、multi-ref | 480p、720p | 4-15 秒 | 9 | 3 | 3 | 16:9、4:3、1:1、3:4、9:16、21:9 |
| Seedance 2.0 Mini<br />`doubao-seedance-2-0-mini-260615` | text2video、image2video、flf2video、multi-image2video、multi-ref | 720p | 4-15 秒 | 9 | 3 | 3 | 16:9、4:3、1:1、3:4、9:16、21:9 |
| Grok Video<br />`grok-imagine-video` | text2video、image2video、multi-image2video、video2video | 720p | 1-15 秒 | 7 | 0 | 1 | 1:1、16:9、9:16、4:3、3:4、3:2、2:3 |
| Grok Video 1.5<br />`grok-imagine-video-1.5` | image2video | 720p | 1-15 秒 | 1 | 0 | 0 | 1:1、16:9、9:16、4:3、3:4、3:2、2:3 |


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