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

# 创建视频任务（方舟兼容）

> 通过火山方舟兼容端点创建异步视频生成任务。一个模型名覆盖文生视频、图生视频与全模态参考生视频。

本端点使用火山方舟的视频任务方言。按 `ark.cn-beijing.volces.com` 文档开发的代码可以原样运行：把 base URL 指向 `https://api.apipod.ai/api/v3`，换成 APIPod API Key，请求体保持不变。鉴权同样使用 `Authorization: Bearer <key>` 请求头。

## 一个模型名，全部场景

与火山控制台不同，你不需要为每种能力挑选不同的 Endpoint ID。`seedance-2.5`、`seedance-2.0-fast` 等 all-in-one 模型 ID 覆盖全部场景：任务类型由 `content` 内容自动推断——仅文本即文生视频；1-2 张帧图即图生视频（首帧或首尾帧）；参考图片、参考视频或参考音频即全模态参考生视频。三种场景互斥；首尾帧图片与参考媒体混用会被 400 拒绝。无 role 的图片按首尾帧处理，因此超过 2 张无 role 图片会按参考图处理。

## 模型命名

`model` 字段不区分大小写，接受以下三类写法：

| 写法               | 示例                                                                                                         |
| ---------------- | ---------------------------------------------------------------------------------------------------------- |
| all-in-one 家族 ID | `seedance-2.5`、`seedance-2.0`、`seedance-2.0-fast`、`seedance-2.0-mini` —— 一个模型，场景由 `content` 推断             |
| 火山原生名（含尾部版本号）    | `doubao-seedance-2-5-260128`、`doubao-seedance-2-0-fast-260128`、`doubao-seedance-1-5-pro-251215` —— 归一为对应家族 |
| 场景后缀 ID          | `seedance-2.5-i2v` —— 场景由模型自身固定                                                                            |

## 参数说明

resolution、ratio、duration、seed、generate\_audio、camera\_fixed、watermark、return\_last\_frame 以及 `tools: [{"type": "web_search"}]` 会透传给模型。可选值随模型而定；不支持的组合与原生 `/v1/videos/generations` 端点的校验行为一致。

部分方舟参数被接受但忽略（平台不映射）：`service_tier`、`priority`、`execution_expires_after`、`safety_identifier`、`output_format`、`draft`、`omni_reference_task_type`。`frames` 参数会返回 400 错误，请改用 `duration`。

## 回调

设置 `callback_url` 后，任务到达终态时会收到一次 POST 推送。回调体与查询接口的响应完全同构，同一套解析代码即可处理两者。其他端点使用的原生回调格式与重试策略见 [Webhooks](/zh-CN/webhooks)。

创建任务后，使用返回的 `id` 轮询 [查询视频任务（方舟兼容）](/zh-CN/ark-query-video-task)。


## OpenAPI

````yaml api-reference/openapi/ark-create-video-task.zh.yaml POST /api/v3/contents/generations/tasks
openapi: 3.1.0
info:
  title: 创建视频生成任务 API（方舟兼容）
  version: 1.0.0
  description: >-
    火山方舟兼容的异步视频生成任务创建端点。将方舟 SDK 或客户端的 base URL 指向本服务即可，请求体与
    ark.cn-beijing.volces.com 保持一致。一个 模型名覆盖全部场景：文生视频、图生视频（首帧或首尾帧）与全模态参考 生视频由
    content 内容自动推断。
servers:
  - url: https://api.apipod.ai
    description: 生产环境
security: []
paths:
  /api/v3/contents/generations/tasks:
    post:
      tags:
        - 视频任务
      summary: 创建视频生成任务
      operationId: post-ark-create-video-task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: >-
                    模型名。接受 APIPod 公开名（seedance-2.5、seedance-2.0、
                    seedance-2.0-fast、seedance-2.0-mini 及特价版本）、火山 原生名（含尾部版本号，如
                    doubao-seedance-2-5-260128）， 以及已带场景后缀的名（seedance-2.5-i2v）。
                  example: seedance-2.5
                content:
                  type: array
                  description: >-
                    输入内容列表。文本即提示词；无 role 或 role 为 first_frame/last_frame 的图片（最多
                    2 张）走图生视频； role 为 reference_image 的图片、参考视频与参考音频走全
                    模态参考生视频。三种场景互斥，不可混用。
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - text
                          - image_url
                          - video_url
                          - audio_url
                        description: 内容项类型。
                      text:
                        type: string
                        description: 文本提示词，type 为 text 时填写。
                      image_url:
                        type: object
                        properties:
                          url:
                            type: string
                            description: 图片 URL 或 data URL。
                        description: 图片对象，type 为 image_url 时填写。
                      video_url:
                        type: object
                        properties:
                          url:
                            type: string
                            description: 参考视频 URL。
                        description: 视频对象，type 为 video_url 时填写。
                      audio_url:
                        type: object
                        properties:
                          url:
                            type: string
                            description: 参考音频 URL。
                        description: 音频对象，type 为 audio_url 时填写。
                      role:
                        type: string
                        enum:
                          - first_frame
                          - last_frame
                          - reference_image
                          - reference_video
                          - reference_audio
                        description: 媒体项角色。无 role 的图片按首尾帧处理。
                  example:
                    - type: text
                      text: 小猫对着镜头打哈欠
                    - type: image_url
                      image_url:
                        url: https://example.com/first.png
                      role: first_frame
                resolution:
                  type: string
                  enum:
                    - 480p
                    - 720p
                    - 1080p
                    - 4k
                  description: 视频分辨率。可选值随模型而定。
                ratio:
                  type: string
                  enum:
                    - '16:9'
                    - '4:3'
                    - '1:1'
                    - '3:4'
                    - '9:16'
                    - '21:9'
                    - adaptive
                  description: 生成视频的宽高比。
                duration:
                  type: integer
                  description: 视频时长（秒）。支持智能选择的模型可传 -1。
                seed:
                  type: integer
                  description: 随机种子。部分模型支持。
                generate_audio:
                  type: boolean
                  description: 是否生成与画面同步的音频。部分模型支持。
                camera_fixed:
                  type: boolean
                  description: 是否固定摄像头。部分模型支持。
                watermark:
                  type: boolean
                  description: 是否添加 AI 生成水印。部分模型支持。
                return_last_frame:
                  type: boolean
                  description: 是否同时返回尾帧图片。
                callback_url:
                  type: string
                  description: 回调地址。任务到达终态时，APIPod 会 POST 与查询接口响应 同构的任务对象。
                tools:
                  type: array
                  description: 工具配置。当前仅识别 web_search，且仅对支持的模型生效。
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - web_search
                        description: 工具类型。
              required:
                - model
                - content
            example:
              model: seedance-2.5
              content:
                - type: text
                  text: 小猫对着镜头打哈欠
              resolution: 720p
              ratio: '16:9'
              duration: 5
      responses:
        '200':
          description: 任务创建成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: 异步任务 ID。使用该值调用查询接口轮询任务。
                  model:
                    type: string
                    description: 本任务使用的公开模型系列名。
                required:
                  - id
                  - model
              example:
                id: 0f4c9f6e-1111-4c1d-8c2f-2b7b9a1c4d55
                model: seedance-2.5
        '400':
          description: 请求不合法，例如携带不支持的 frames 参数或混用了互斥的 content 场景。
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: 方舟风格错误码。
                      message:
                        type: string
                        description: 面向客户端的安全错误信息。
        '401':
          description: 鉴权失败。
        '402':
          description: 余额不足。
        '404':
          description: 模型不存在。
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: APIPod API key
      description: 在 Authorization 头中以 Bearer 方式携带 APIPod API Key。

````