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

# 视频生成(异步)

> 通过调用 [视频模型](/cn/guide/models/video-generation/cogvideox-3) 能力生成视频内容。支持多种视频生成方式，包括文本转视频、图像转视频等。注意此为异步接口，通过 [查询异步结果](/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%9F%A5%E8%AF%A2%E5%BC%82%E6%AD%A5%E7%BB%93%E6%9E%9C) 获取生成视频结果。点击 **Try it** 按钮可快速试用。



## OpenAPI

````yaml /openapi/openapi.json post /paas/v4/videos/generations
openapi: 3.0.1
info:
  title: ZHIPU AI API
  description: ZHIPU AI 接口提供强大的 AI 能力，包括聊天对话、工具调用和视频生成。
  license:
    name: ZHIPU AI 开发者协议和政策
    url: https://chat.z.ai/legal-agreement/terms-of-service
  version: 1.0.0
  contact:
    name: Z.AI 开发者
    url: https://chat.z.ai/legal-agreement/privacy-policy
    email: user_feedback@z.ai
servers:
  - url: https://open.bigmodel.cn/api/
    description: 开放平台服务
security:
  - bearerAuth: []
tags:
  - name: 模型 API
    description: Chat API
  - name: 工具 API
    description: Web Search API
  - name: Agent API
    description: Agent API
  - name: 文件 API
    description: File API
  - name: 知识库 API
    description: Knowledge API
  - name: 实时 API
    description: Realtime API
  - name: 批处理 API
    description: Batch API
  - name: 助理 API
    description: Assistant API
  - name: 智能体 API（旧）
    description: QingLiu Agent API
paths:
  /paas/v4/videos/generations:
    post:
      tags:
        - 模型 API
      summary: 视频生成(异步)
      description: >-
        通过调用 [视频模型](/cn/guide/models/video-generation/cogvideox-3)
        能力生成视频内容。支持多种视频生成方式，包括文本转视频、图像转视频等。注意此为异步接口，通过
        [查询异步结果](/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%9F%A5%E8%AF%A2%E5%BC%82%E6%AD%A5%E7%BB%93%E6%9E%9C)
        获取生成视频结果。点击 **Try it** 按钮可快速试用。
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/CogVideoX3Request'
                  title: CogVideoX-3
                - $ref: '#/components/schemas/CogVideoXRequest'
                  title: CogVideoX
                - $ref: '#/components/schemas/ViduText2VideoRequest'
                  title: 'Vidu: Text to Video'
                - $ref: '#/components/schemas/ViduImage2VideoRequest'
                  title: 'Vidu: Image to Video'
                - $ref: '#/components/schemas/ViduFrames2VideoRequest'
                  title: 'Vidu: First & Last Frame to Video'
                - $ref: '#/components/schemas/ViduReference2VideoRequest'
                  title: 'Vidu: Ref to Video'
            examples:
              文生视频示例:
                value:
                  model: cogvideox-3
                  prompt: A cat is playing with a ball.
                  quality: quality
                  with_audio: true
                  size: 1920x1080
                  fps: 30
              图生视频示例:
                value:
                  model: cogvideox-3
                  image_url: >-
                    https://img.iplaysoft.com/wp-content/uploads/2019/free-images/free_stock_photo.jpg
                  prompt: 让画面动起来
                  quality: quality
                  with_audio: true
                  size: 1920x1080
                  fps: 30
              首尾帧生示例:
                value:
                  model: cogvideox-3
                  image_url:
                    - >-
                      https://cdn.bigmodel.cn/markdown/1752547801491cogvideo4.png
                    - >-
                      https://cdn.bigmodel.cn/markdown/1752547813297cogvideo5.png
                  prompt: 让画面动起来
                  quality: quality
                  with_audio: true
                  size: 1920x1080
                  fps: 30
        required: true
      responses:
        '200':
          description: 业务处理成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncResponse'
        default:
          description: 请求失败。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CogVideoX3Request:
      allOf:
        - $ref: '#/components/schemas/BaseVideoGenerationRequest'
        - type: object
          properties:
            model:
              type: string
              description: 要调用的模型编码。
              enum:
                - cogvideox-3
            prompt:
              type: string
              example: A cat is playing with a ball.
              description: 视频的文本描述，字符长度不能超过`512`个字符。`image_url` 和 `prompt` 不能同时为空。
            image_url:
              $ref: '#/components/schemas/ImageUrlInputExtended'
              description: >-
                提供基于其生成内容的图像，如果传入此参数，系统将以该图像为基础进行操作。支持通过`URL`或`Base64`编码传入图片。图片要求如下：图片支持.`png、.jpeg、.jpg`
                格式、图片大小：不超过`5M`。 `image_url` 和 `prompt` 不能同时为空。

                首尾帧：支持输入两张图，上传的第一张图片视作首帧图，第二张图片视作尾帧图，模型将以此参数中传入的图片来生成视频。
            size:
              type: string
              description: 默认值：若不指定，默认生成视频的短边为 `1080`，长边根据原图片比例确认。最高支持 `4K` 分辨率。
              example: 1920x1080
              enum:
                - 1280x720
                - 720x1280
                - 1024x1024
                - 1920x1080
                - 1080x1920
                - 2048x1080
                - 3840x2160
            fps:
              type: integer
              description: 视频帧率（`FPS`），可选值为 `30` 或 `60`。默认值：`30`。
              example: 30
              enum:
                - 30
                - 60
            duration:
              type: integer
              description: 视频持续时长，默认`5`秒，支持`5`、`10`
              example: 5
              enum:
                - 5
                - 10
          required:
            - model
        - $ref: '#/components/schemas/VideoCommonRequest'
    CogVideoXRequest:
      allOf:
        - $ref: '#/components/schemas/BaseVideoGenerationRequest'
        - type: object
          properties:
            model:
              type: string
              description: 要调用的代码。
              enum:
                - cogvideox-2
                - cogvideox-flash
            prompt:
              type: string
              description: 视频的文本描述，最大输入长度为 `512` 个字符。必须提供 `image_url` 或 `prompt`，或两者都提供。
            image_url:
              $ref: '#/components/schemas/ImageUrlInput'
              description: >-
                用于内容生成的基础图像。如果提供，系统将基于此图像进行操作。支持 `URL` 或 `Base64` 编码图像。图像要求：支持
                `.png、.jpeg、.jpg` 格式；图像大小不超过 `5M`。必须提供 `image_url` 或
                `prompt`，或两者都提供。
            size:
              type: string
              description: >-
                默认：如果未指定，生成视频的短边默认为 `1080`，长边根据原始图像比例缩放。支持最高 `4K`
                分辨率。分辨率选项：`720x480`、`1024x1024`、`1280x960`、`960x1280`、`1920x1080`、`1080x1920`、`2048x1080`、`3840x2160`。
              example: 1920x1080
              enum:
                - 720x480
                - 1024x1024
                - 1280x960
                - 960x1280
                - 1920x1080
                - 1080x1920
                - 2048x1080
                - 3840x2160
            fps:
              type: integer
              description: 视频帧率（`FPS`），可选值为 `30` 或 `60`。默认：`30`。
              example: 30
              enum:
                - 30
                - 60
          required:
            - model
        - $ref: '#/components/schemas/VideoCommonRequest'
    ViduText2VideoRequest:
      allOf:
        - type: object
          properties:
            model:
              type: string
              description: 要调用的代码。
              enum:
                - viduq1-text
            prompt:
              type: string
              description: 视频的文本描述，最大输入长度为 `512` 个字符。
            style:
              type: string
              description: |-
                风格
                默认：`general`
                可选值：`general`、`anime`
                `general`：通用风格，可以使用提示词控制定义风格。
                `anime`：动漫风格，针对动漫特定视觉效果进行优化。可以使用不同的动漫主题提示词控制风格。
              enum:
                - general
                - anime
            duration:
              type: integer
              description: |-
                视频时长参数。
                默认：`5`，可选：`5`。
              example: 5
              enum:
                - 5
            aspect_ratio:
              type: string
              description: |-
                宽高比
                默认：`16:9`，可选值：`16:9`、`9:16`、`1:1`
              example: '16:9'
              enum:
                - '16:9'
                - '9:16'
                - '1:1'
            size:
              type: string
              description: |-
                分辨率参数
                默认：`1920x1080`，可选：`1920x1080`
              example: 1920x1080
              enum:
                - 1920x1080
            movement_amplitude:
              type: string
              description: |-
                运动幅度
                默认：`auto`，可选值：`auto`、`small`、`medium`、`large`
              example: auto
              enum:
                - auto
                - small
                - medium
                - large
          required:
            - model
            - prompt
        - $ref: '#/components/schemas/VideoCommonRequest'
    ViduImage2VideoRequest:
      allOf:
        - type: object
          properties:
            model:
              type: string
              description: 要调用的代码。
              enum:
                - viduq1-image
                - vidu2-image
            prompt:
              type: string
              description: 视频的文本描述，最大输入长度为 `512` 个字符。必须提供 `image_url` 或 `prompt`，或两者都提供。
            image_url:
              $ref: '#/components/schemas/ImageUrlInput'
              description: >-
                系统将使用此参数中提供的图像作为第一帧来生成视频。

                仅支持 `1` 张图像。

                支持的格式：`png`、`jpeg`、`jpg`、`webp`。

                图像宽高比必须小于 `1:4` 或 `4:1`。

                图像文件大小不得超过 `50MB`。

                注意：`Base64` 解码后，字节长度必须小于
                `50MB`，编码必须包含适当的内容类型字符串（例如，`data:image/png;base64,{base64_encode}`）。
            duration:
              oneOf:
                - title: viduq1-image
                  type: integer
                  description: |-
                    视频时长参数。
                    默认：`5`，可选：`5`。
                  example: 5
                  enum:
                    - 5
                - title: viduq2-image
                  type: integer
                  description: |-
                    视频时长参数。
                    默认：`4`，可选：`4`。
                  example: 4
                  enum:
                    - 4
            size:
              oneOf:
                - title: viduq1-image
                  type: string
                  description: |-
                    分辨率参数
                    默认：`1920x1080`，可选：`1920x1080`
                  example: 1920x1080
                  enum:
                    - 1920x1080
                - title: viduq2-image
                  type: string
                  description: |-
                    分辨率参数
                    默认：`1280x720`，可选：`1280x720`
                  example: 1280x720
                  default: 1280x720
                  enum:
                    - 1280x720
            movement_amplitude:
              type: string
              description: |-
                运动幅度
                默认：`auto`，可选值：`auto`、`small`、`medium`、`large`
              example: auto
              enum:
                - auto
                - small
                - medium
                - large
            with_audio:
              type: boolean
              description: 为生成的视频添加背景音乐，仅当最终生成的视频时长为 `4`秒 时支持。
          required:
            - model
        - $ref: '#/components/schemas/VideoCommonRequest'
    ViduFrames2VideoRequest:
      allOf:
        - type: object
          properties:
            model:
              type: string
              description: 要调用的代码。
              enum:
                - viduq1-start-end
                - vidu2-start-end
            prompt:
              type: string
              description: 视频的文本描述，最大输入长度为 `512` 个字符。必须提供 `image_url` 或 `prompt`，或两者都提供。
            image_url:
              type: array
              description: >-
                图像

                支持输入两张图像：第一张上传的图像将被视为第一帧，第二张图像作为最后一帧。模型将使用此参数中提供的图像来生成视频。

                两张输入图像（第一帧和最后一帧）的分辨率必须相似，第一帧分辨率与最后一帧分辨率的比例应在 `0.8–1.25`
                范围内。此外，图像宽高比必须小于 `1:4` 或 `4:1`。

                支持图像 `URL` 或 `Base64` 编码的图像（确保可访问性；建议使用图像 URL）。

                支持的格式：`png`、`jpeg`、`.jpg`、`webp`。

                图像文件大小不得超过 `50 MB`。

                注意：`Base64` 解码后，字节长度必须小于 `50MB`，编码必须包含适当的内容类型字符串，例如
                `data:image/png;base64,{base64_encode}`。
              items:
                type: string
                minLength: 1
              minItems: 1
              maxItems: 2
            duration:
              oneOf:
                - title: viduq1-start-end
                  type: integer
                  description: |-
                    视频时长参数。
                    默认：`5`，可选：`5`。
                  example: 5
                  enum:
                    - 5
                - title: vidu2-start-end
                  type: integer
                  description: |-
                    视频时长参数。
                    默认：`4`，可选：`4`。
                  example: 4
                  enum:
                    - 4
            size:
              oneOf:
                - title: viduq1-start-end
                  type: string
                  description: |-
                    分辨率参数
                    默认：`1920x1080`，可选：`1920x1080`
                  example: 1920x1080
                  enum:
                    - 1920x1080
                - title: vidu2-start-end
                  type: string
                  description: |-
                    分辨率参数
                    默认：`1280x720`，可选：`1280x720`, `480x360`
                  example: 1280x720
                  default: 1280x720
                  enum:
                    - 1280x720
                    - 480x360
            movement_amplitude:
              type: string
              description: |-
                运动幅度
                默认：`auto`，可选值：`auto`、`small`、`medium`、`large`
              example: auto
              enum:
                - auto
                - small
                - medium
                - large
            with_audio:
              type: boolean
              description: 为生成的视频添加背景音乐。
          required:
            - model
        - $ref: '#/components/schemas/VideoCommonRequest'
    ViduReference2VideoRequest:
      allOf:
        - type: object
          properties:
            model:
              type: string
              description: 要调用的代码。
              enum:
                - vidu2-reference
            prompt:
              type: string
              description: 视频的文本描述，最大输入长度为 `512` 个字符。必须提供 `image_url` 或 `prompt`，或两者都提供。
            image_url:
              type: array
              description: >-
                图像参考

                支持输入 `1` 到 `3` 张图像。模型将使用此参数中提供的图像主题作为参考，生成具有一致主体的视频。

                1. 支持图像 `URL` 或 `Base64` 编码的图像（确保可访问性；建议优先使用图像 URL）。

                2. 支持的格式：`png`、`jpeg`、`.jpg`、`webp`。

                3. 图像分辨率不得小于 `128x128`，宽高比必须小于 `1:4` 或 `4:1`。

                4. 图像文件大小不得超过 `50 MB`。

                5. 注意：`Base64` 解码后，字节长度必须小于 `50MB`，编码必须包含适当的内容类型字符串，例如
                `data:image/png;base64,{base64_encode}`。
              items:
                type: string
                minLength: 1
              minItems: 1
              maxItems: 3
            duration:
              title: vidu2-reference
              type: integer
              description: |-
                视频时长参数。
                默认：`4`，可选：`4`。
              example: 4
              enum:
                - 4
            aspect_ratio:
              type: string
              description: |-
                宽高比
                默认：`16:9`，可选值：`16:9`、`9:16`、`1:1`
              example: '16:9'
              enum:
                - '16:9'
                - '9:16'
                - '1:1'
            size:
              title: 'vidu2-reference '
              type: string
              description: |-
                分辨率参数
                默认：`1280x720`，可选：`1280x720`
              example: 1280x720
              enum:
                - 1280x720
            movement_amplitude:
              type: string
              description: |-
                运动幅度
                默认：`auto`，可选值：`auto`、`small`、`medium`、`large`
              example: auto
              enum:
                - auto
                - small
                - medium
                - large
            with_audio:
              type: boolean
              description: 为生成的视频添加背景音乐。
          required:
            - model
        - $ref: '#/components/schemas/VideoCommonRequest'
    AsyncResponse:
      type: object
      properties:
        model:
          description: 此次调用使用的名称。
          type: string
        id:
          description: 生成的任务`ID`，调用请求结果接口时使用此`ID`。
          type: string
        request_id:
          description: 用户在客户端请求期间提交的任务编号或平台生成的任务编号。
          type: string
        task_status:
          description: 处理状态，`PROCESSING (处理中)`、`SUCCESS (成功)`、`FAIL (失败)`。结果需要通过查询获取。
          type: string
    Error:
      type: object
      properties:
        error:
          required:
            - code
            - message
          type: object
          properties:
            code:
              type: string
            message:
              type: string
    BaseVideoGenerationRequest:
      type: object
      properties:
        prompt:
          type: string
          description: 视频的文本描述
        quality:
          type: string
          description: 输出模式，默认为 `speed`。 `quality`：质量优先，生成质量高。 `speed`：速度优先，生成时间更快，质量相对稍低。
          example: speed
          enum:
            - speed
            - quality
        with_audio:
          type: boolean
          description: 是否生成 `AI` 音效。默认值：`False` （不生成音效）。
          example: false
        watermark_enabled:
          type: boolean
          description: |-
            控制`AI`生成图片时是否添加水印。
             - `true`: 默认启用`AI`生成的显式水印及隐式数字水印，符合政策要求。
             - `false`: 关闭所有水印，仅允许已签署免责声明的客户使用，签署路径：个人中心-安全管理-去水印管理
          example: true
    ImageUrlInputExtended:
      oneOf:
        - $ref: '#/components/schemas/ImageUrlInput'
        - title: Image URLs Array (First & Last Frame)
          type: array
          items:
            type: string
            format: uri
          minItems: 2
          maxItems: 2
          example:
            - https://example.com/first_frame.png
            - https://example.com/last_frame.png
    VideoCommonRequest:
      type: object
      properties:
        request_id:
          type: string
          description: 由客户端提供，必须唯一；用于区分每个请求的唯一标识符。如果客户端未提供，平台将默认生成一个。
        user_id:
          type: string
          description: >-
            终端用户的唯一 `ID`，协助平台干预终端用户违规、生成非法或不当信息或其他滥用行为。`ID` 长度要求：最少 `6` 个字符，最多
            `128` 个字符。
    ImageUrlInput:
      oneOf:
        - title: Image URL
          type: string
          format: uri
          example: https://example.com/image.png
        - title: Base64 Encoded Image
          type: string
          format: byte
          example: data:image/png;base64, XXX
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        标准的 HTTP Bearer 认证方式，在 [API
        Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) 页面获取密钥。

````