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

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

> 接口说明：火山方舟视频生成兼容接口，适用于已经接入火山视频生成 API、希望迁移到 AiToEarn 但不想大改请求结构的客户。请求体保持火山格式，只需要将请求地址替换为 AiToEarn 地址，并将鉴权改为 `X-Api-Key`。参考火山官方文档：[创建视频生成任务](https://www.volcengine.com/docs/82379/1520757?lang=zh)。



## OpenAPI

````yaml /openapi/zh/aitoearn.openapi.json post /api/ai/volcengine/video
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: 渠道管理
  - name: 渠道管理/账号
  - name: 渠道管理/内容发布
  - name: 渠道管理/平台
  - name: 渠道管理/作品
  - name: 渠道管理/账号分组
  - name: 渠道管理/授权
  - name: 资源管理
  - name: AI 服务/大语言模型
paths:
  /api/ai/volcengine/video:
    post:
      tags:
        - AI 服务/视频生成
      summary: 火山格式创建视频生成任务
      description: >-
        接口说明：火山方舟视频生成兼容接口，适用于已经接入火山视频生成 API、希望迁移到 AiToEarn
        但不想大改请求结构的客户。请求体保持火山格式，只需要将请求地址替换为 AiToEarn 地址，并将鉴权改为
        `X-Api-Key`。参考火山官方文档：[创建视频生成任务](https://www.volcengine.com/docs/82379/1520757?lang=zh)。
      operationId: VolcengineVideoController_videoGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: 模型 ID 或 Endpoint ID。
                content:
                  type: array
                  description: 输入给模型、用于生成视频的内容，保持火山方舟视频生成格式。
                  items:
                    oneOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - text
                            description: 内容类型，文本内容固定为 text。
                          text:
                            type: string
                            description: 文本提示词，用于描述期望生成的视频。
                        required:
                          - type
                          - text
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - image_url
                            description: 内容类型，图片内容固定为 image_url。
                          image_url:
                            type: object
                            properties:
                              url:
                                type: string
                                description: 图片 URL 或 base64 图片数据。
                            required:
                              - url
                            additionalProperties: false
                          role:
                            type: string
                            enum:
                              - first_frame
                              - last_frame
                              - reference_image
                            description: 图片用途：首帧、尾帧或参考图。
                        required:
                          - type
                          - image_url
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - video_url
                            description: 内容类型，视频内容固定为 video_url。
                          video_url:
                            type: object
                            properties:
                              url:
                                type: string
                                description: 参考视频 URL 或素材 ID。
                            required:
                              - url
                            additionalProperties: false
                          role:
                            type: string
                            enum:
                              - reference_video
                            description: 视频用途，当前固定为 reference_video。
                        required:
                          - type
                          - video_url
                          - role
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - audio_url
                            description: 内容类型，音频内容固定为 audio_url。
                          audio_url:
                            type: object
                            properties:
                              url:
                                type: string
                                description: 参考音频 URL、base64 音频数据或素材 ID。
                            required:
                              - url
                            additionalProperties: false
                          role:
                            type: string
                            enum:
                              - reference_audio
                            description: 音频用途，当前固定为 reference_audio。
                        required:
                          - type
                          - audio_url
                          - role
                        additionalProperties: false
                return_last_frame:
                  type: boolean
                  description: 是否返回尾帧图像。
                tools:
                  type: array
                  description: 模型工具配置。
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - web_search
                        description: 工具类型。
                    required:
                      - type
                    additionalProperties: false
                resolution:
                  type: string
                  description: 分辨率。
                ratio:
                  type: string
                  description: 宽高比。
                duration:
                  type: integer
                  description: 时长（秒）。
                seed:
                  type: integer
                  description: 随机种子。
                watermark:
                  type: boolean
                  description: 是否带水印。
                generate_audio:
                  type: boolean
                  description: 是否生成与画面同步的音频，Seedance 2.0 系列支持。
                execution_expires_after:
                  type: integer
                  minimum: 3600
                  maximum: 259200
                  description: 任务超时阈值（秒），取值范围 [3600, 259200]。
                priority:
                  type: integer
                  minimum: 0
                  maximum: 9
                  description: 任务执行优先级 0-9，数值越大优先级越高，Seedance 2.0 系列支持。
                safety_identifier:
                  type: string
                  description: 终端用户唯一标识符，原样透传给方舟用于合规检测。
                source:
                  type: string
                  enum:
                    - ai_video
                    - ai_draft_generation
                    - plugin
                  description: 消费来源。
              required:
                - model
                - content
              additionalProperties: false
            examples:
              textToVideo:
                summary: 文本生成视频
                value:
                  model: doubao-seedance-2-0-260128
                  content:
                    - type: text
                      text: >-
                        Create a cinematic product video with close-up shots,
                        soft studio lighting, and smooth camera movement.
                  generate_audio: true
                  ratio: '16:9'
                  duration: 8
                  watermark: false
      responses:
        '200':
          description: 火山格式原生响应，不使用 AiToEarn 通用响应包裹。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VolcengineVideoGenerationResponseVo'
              examples:
                success:
                  summary: 成功
                  value:
                    id: 6a461da66fe8a12d33daabdd
      security:
        - apikey-header-X-Api-Key: []
components:
  schemas:
    VolcengineVideoGenerationResponseVo:
      type: object
      properties:
        id:
          type: string
      required:
        - id
      additionalProperties: false
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 需要从 AiToEarn 获取 API Key。点击前往[「API Key 获取教程」](/zh/use/api-key)。

````