> ## 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.

# 生成视频

> 接口说明：提交视频生成任务，支持 seedance 系列模型；可传入参考图片、视频、音频，生成成功后可保存到指定素材组。任务异步执行，返回 taskId 用于轮询结果。



## OpenAPI

````yaml /openapi/zh/aitoearn.openapi.json post /api/ai/video/generations
openapi: 3.0.1
info:
  title: AiToEarn 开放平台 API
  description: AiToEarn 开放平台 API，支持在中国站与国际站之间切换调试。业务是否成功以响应体 code === 0 为准。
  version: 1.0.0
  contact: {}
servers:
  - url: https://aitoearn.cn
    description: 中国站
  - url: https://aitoearn.ai
    description: 国际站
security: []
tags:
  - name: AI 服务
  - name: AI 服务/视频生成
  - name: AI 服务/图像生成
  - name: AI 服务/模型中转
  - name: 渠道管理
  - name: 渠道管理/账号
  - name: 渠道管理/内容发布
  - name: 渠道管理/平台
  - name: 渠道管理/互动
  - name: 渠道管理/作品
  - name: 渠道管理/账号分组
  - name: 渠道管理/授权
  - name: 资源管理
paths:
  /api/ai/video/generations:
    post:
      tags:
        - AI 服务/视频生成
      summary: 生成视频
      description: >-
        接口说明：提交视频生成任务，支持 seedance 系列模型；可传入参考图片、视频、音频，生成成功后可保存到指定素材组。任务异步执行，返回
        taskId 用于轮询结果。
      operationId: VideoController_videoGeneration
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: >
                    模型名称

                    - seedance-2-fast-beta：支持 480p、720p；时长 4-15 秒；宽高比
                    21:9、16:9、4:3、1:1、3:4、9:16

                    - seedance-2-beta：支持 720p；时长 4-15 秒；宽高比
                    21:9、16:9、4:3、1:1、3:4、9:16

                    - seedance-2-beta-1080p：支持 1080p；时长 8-15 秒；宽高比 16:9、9:16、1:1
                  minLength: 1
                  enum:
                    - seedance-2-fast-beta
                    - seedance-2-beta
                    - seedance-2-beta-1080p
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 4000
                  description: 提示词，长度 1-4000 字符
                groupId:
                  description: 素材组 ID，传入后生成成功时保存到该素材组
                  type: string
                image:
                  description: 单张参考图片 URL，与 images 合计最多 9 张；图片、视频、音频参考媒体合计最多 12 个
                  anyOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                images:
                  description: 参考图片 URL 列表，与 image 合计最多 9 张；图片、视频、音频参考媒体合计最多 12 个
                  type: array
                  items:
                    type: string
                videos:
                  description: >
                    参考视频 URL 列表，最多 3 个；图片、视频、音频参考媒体合计最多 12 个

                    支持格式：mp4、mov

                    单个时长：2-15 秒；总时长最多 15 秒

                    单个文件最大 50MB；宽高比 0.4-2.5；宽度 300-6000；像素数 409600-2086876；帧率
                    24-60。
                  type: array
                  items:
                    type: string
                audios:
                  description: |
                    参考音频 URL 列表，最多 3 个；图片、视频、音频参考媒体合计最多 12 个
                    支持格式：wav、mp3
                    单个时长：2-15 秒；总时长最多 15 秒；单个文件最大 15MB
                  type: array
                  items:
                    type: string
                resolution:
                  type: string
                  description: |
                    分辨率
                    seedance-2-fast-beta 支持 480p、720p
                    seedance-2-beta 只支持 720p
                    seedance-2-beta-1080p 只支持 1080p
                  enum:
                    - 480p
                    - 720p
                    - 1080p
                ratio:
                  description: >
                    宽高比

                    seedance-2-fast-beta、seedance-2-beta 支持
                    21:9、16:9、4:3、1:1、3:4、9:16

                    seedance-2-beta-1080p 支持 16:9、9:16、1:1
                  type: string
                duration:
                  description: |
                    时长（秒）
                    seedance-2-fast-beta、seedance-2-beta 支持 4-15 秒
                    seedance-2-beta-1080p 支持 8-15 秒
                  type: number
                source:
                  description: 消费来源
                  type: string
                  enum:
                    - ai_video
                    - ai_draft_generation
                    - plugin
              required:
                - model
                - prompt
            examples:
              '1':
                value:
                  model: seedance-2-beta-1080p
                  prompt: 生成一条旅行 vlog 风格视频，图片作为主体参考，视频作为运动参考，音频作为节奏参考，画面自然真实
                  images:
                    - https://example.com/input/character.png
                  videos:
                    - https://example.com/input/motion-reference.mp4
                  audios:
                    - https://example.com/input/music-reference.mp3
                  resolution: 1080p
                  ratio: '9:16'
                  duration: 12
                summary: 多参考生成视频
              '2':
                value:
                  model: seedance-2-fast-beta
                  prompt: 一盏智能台灯在现代摄影棚中缓缓亮起，镜头平滑推进，画面干净高级，产品反光自然
                  resolution: 480p
                  ratio: '16:9'
                  duration: 6
                summary: 文本生成视频
        required: true
      responses:
        '200':
          description: 请求已被服务处理。业务是否成功以响应体 code === 0 为准。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/VideoGenerationResponseVo'
                  code:
                    type: integer
                    description: 业务状态码。0 表示成功，非 0 表示业务错误。
                  message:
                    type: string
                    description: 响应消息。
                  requestId:
                    type: string
                    description: 请求 ID。
                  timestamp:
                    type: integer
                    description: 错误响应时间戳，Unix 毫秒。
                required:
                  - code
                  - message
              examples:
                success:
                  summary: 成功
                  value:
                    code: 0
                    message: 请求成功
                    data:
                      id: string
                      status: string
                validationFailed10002:
                  summary: ValidationFailed (10002)
                  value:
                    code: 10002
                    message: 参数验证失败
                    data: {}
                    timestamp: 1772099056662
                unauthorized401:
                  summary: 未认证或 API Key 无效
                  value:
                    code: 401
                    message: Unauthorized
                    data: {}
                    timestamp: 1772099056662
                aiVideoGenerationUnsupportedMode12310:
                  summary: AiVideoGenerationUnsupportedMode (12310)
                  value:
                    code: 12310
                    message: 不支持的视频生成模式
                    data: {}
                    timestamp: 1772099056662
                invalidModel12300:
                  summary: InvalidModel (12300)
                  value:
                    code: 12300
                    message: 无效的 AI 模型
                    data: {}
                    timestamp: 1772099056662
                materialGroupNotFound12801:
                  summary: MaterialGroupNotFound (12801)
                  value:
                    code: 12801
                    message: 素材分组未找到
                    data: {}
                    timestamp: 1772099056662
      deprecated: false
      security:
        - apikey-header-X-Api-Key: []
components:
  schemas:
    VideoGenerationResponseVo:
      type: object
      properties:
        id:
          type: string
          description: 任务 ID
        status:
          type: string
          description: 任务状态
      required:
        - id
        - status
      additionalProperties: false
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: AiToEarn Open Platform API Key。

````