---
title: "火山格式创建视频生成任务"
method: POST
path: "/api/ai/v3/contents/generations/tasks"
tags: ["AI 服务/视频生成"]
---

# 火山格式创建视频生成任务

`POST /api/ai/v3/contents/generations/tasks`

## Request

- Base URL: `https://aitoearn.cn`
- URL: `https://aitoearn.cn/api/ai/v3/contents/generations/tasks`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/aitoearn/apis/aitoearn-api/docs/api/ai/v3/contents/generations/tasks/post.ts> (a function with typed inputs; its response is checked against the schema)

接口说明：火山方舟视频生成兼容接口，适用于已经接入火山视频生成 API、希望迁移到 AiToEarn 但不想大改请求结构的客户。参考火山官方文档：[创建视频生成任务](https://www.volcengine.com/docs/82379/1520757?lang=zh)。

## Request body

- object
  - `model` string, required: 模型 ID 或 Endpoint ID。
  - `content` union[], required: 输入给模型、用于生成视频的内容，保持火山方舟视频生成格式。 注意：使用真人素材或虚拟人像素材，传入 `asset://<asset ID>` 即可生成视频。使用真人素材生成视频失败时，请改用「创建虚拟人像组」。 Seedance 2.0 系列模型支持以下输入组合： - **文本** - **文本 + 图片** - **文本 + 视频** - **文本 + 图片 + 音频** - **文本 + 图片 + 视频** - **文本 + 视频 + 音频** - **文本 + 图片 + 视频 + 音频**
    - union
      - object
        - `type` 'text', required: 内容类型，文本内容固定为 text。
        - `text` string, required: 文本提示词，用于描述期望生成的视频。
      - object
        - `type` 'image_url', required: 内容类型，图片内容固定为 image_url。
        - `image_url` object, required
          - `url` string, required: 图片 URL 或 base64 图片数据。注意：使用真人素材或虚拟人像素材，传入 `asset://<asset ID>` 即可生成视频。
        - `role` 'first_frame' | 'last_frame' | 'reference_image': 图片用途：首帧、尾帧或参考图。
      - object
        - `type` 'video_url', required: 内容类型，视频内容固定为 video_url。
        - `video_url` object, required
          - `url` string, required: 参考视频 URL。注意：使用真人素材或虚拟人像素材，传入 `asset://<asset ID>` 即可生成视频。
        - `role` 'reference_video', required: 视频用途，当前固定为 reference_video。
      - object
        - `type` 'audio_url', required: 内容类型，音频内容固定为 audio_url。
        - `audio_url` object, required
          - `url` string, required: 参考音频 URL 或 base64 音频数据。注意：使用真人素材或虚拟人像素材，传入 `asset://<asset ID>` 即可生成视频。
        - `role` 'reference_audio', required: 音频用途，当前固定为 reference_audio。
  - `return_last_frame` boolean: 是否返回尾帧图像。
  - `tools` object[]: 模型工具配置。
    - `type` 'web_search', required: 工具类型。
  - `resolution` string: 分辨率。
  - `ratio` string: 宽高比。
  - `duration` integer: 时长（秒）。
  - `seed` integer: 随机种子。
  - `watermark` boolean: 是否带水印。
  - `generate_audio` boolean: 是否生成与画面同步的音频，Seedance 2.0 系列支持。
  - `execution_expires_after` integer: 任务超时阈值（秒），取值范围 [3600, 259200]。
  - `priority` integer: 任务执行优先级 0-9，数值越大优先级越高，Seedance 2.0 系列支持。
  - `safety_identifier` string: 终端用户唯一标识符，原样透传给方舟用于合规检测。
  - `source` 'ai_video' | 'ai_draft_generation' | 'plugin': 消费来源。

## Response `200`

火山格式原生响应，不使用 AiToEarn 通用响应包裹。

- VolcengineVideoGenerationResponseVo
  - `id` string, required

---

[API](https://skmtc.dev/aitoearn/apis/aitoearn-api.md) - [All operations](https://skmtc.dev/aitoearn/apis/aitoearn-api/llms.txt) - [OpenAPI document](https://skmtc.dev/aitoearn/apis/aitoearn-api/revisions/7cc8f21c4c96?raw)
