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

# Vidu Q4

> 根据一张起始帧或参考图片生成 3–16 秒的视频，可选附带参考音频，分辨率从 540p 到 4k。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.poyo.ai/zh/api-manual/task-management/status.md)接口获取结果。

Vidu Q4 可让起始帧动起来，或使用参考图片引导生成结果。参考图片可选搭配参考音频。

## 模型

* **vidu-q4** — 图生视频和参考生视频

## 功能

* 生成 3 到 16 秒的视频。
* 让一张起始帧图片动起来，或使用 1–12 张参考图片及最多 3 个可选参考音频文件引导视频。
* 可选择 540p 到 4k 的输出分辨率。
* 在参考生视频模式下可选生成音轨。

## 输入模式

* **图生视频**：在 `image_urls` 中提供恰好一个 URL。`prompt` 为可选。此模式不能与 `reference_image_urls` 或 `reference_audio_urls` 同时使用，也不要传 `aspect_ratio` 或 `generate_audio`。
* **参考生视频**：提供 `prompt`，并在 `reference_image_urls` 中提供 1–12 个 URL。`reference_audio_urls` 为可选，且必须与参考图片一起使用。不要传 `image_urls`。

## 必填参数

* `prompt` (string)：参考生视频时必填。长度必须为 1–5,000 个字符，且不能为空白。
* `image_urls` (array of strings)：图生视频时必填。必须包含恰好一个起始帧图片 URL。
* `reference_image_urls` (array of strings)：参考生视频时必填。必须包含 1–12 个参考图片 URL。

## 可选参数

* `prompt` (string)：图生视频时可选，最多 5,000 个字符。
* `reference_audio_urls` (array of strings)：搭配 `reference_image_urls` 的可选音频，最多 3 个文件。每个文件必须为 MP3，时长 3–12 秒。没有参考图片时不能使用音频。
* `duration` (integer)：输出时长，3 到 16 秒。默认为 `5`。
* `resolution` (string)：`540p`、`720p`、`1080p`、`2k` 或 `4k`。默认为 `720p`。
* `aspect_ratio` (string)：`16:9`、`9:16`、`4:3`、`3:4` 或 `1:1`。默认为 `16:9`。仅用于参考生视频。
* `generate_audio` (boolean)：生成音轨。默认为 `false`。仅用于参考生视频。
* `enable_safety_checker` (boolean)：启用内容安全检查。默认为 `true`。

## 示例

请求示例展示了带可选提示词的单张起始帧动画，以及由参考图片引导、可选附带音频的生成。两种模式使用同一个 `vidu-q4` model ID。

## 注意事项

* 所有生成参数都放在 `input` 中。
* 图片必须使用可公开访问的 HTTP 或 HTTPS URL。
* 参考音频必须使用可公开访问的 HTTP 或 HTTPS URL。
* 图生视频会拒绝 `aspect_ratio` 和 `generate_audio`，即使 `generate_audio` 为 `false` 也会拒绝。


## OpenAPI

````yaml zh/api-manual/video-series/vidu-q4.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidu Q4
  description: 根据一张起始帧或参考图片生成视频，可选参考音频。
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      summary: 提交 Vidu Q4 视频任务
      operationId: submit_vidu_q4
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              image-to-video:
                summary: 让一张起始帧动起来
                value:
                  model: vidu-q4
                  input:
                    image_urls:
                      - https://example.com/start-frame.png
              reference-to-video:
                summary: 由参考图片和音频引导的视频
                value:
                  model: vidu-q4
                  input:
                    prompt: >-
                      Animate the character from the reference image with
                      movement guided by the reference audio.
                    reference_image_urls:
                      - https://example.com/character.png
                    reference_audio_urls:
                      - https://example.com/reference.mp3
                    duration: 5
                    resolution: 720p
      responses:
        '200':
          description: 任务提交成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: 请求参数无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 未授权：API Key 无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      additionalProperties: false
      required:
        - model
        - input
      properties:
        model:
          type: string
          enum:
            - vidu-q4
          description: 公开的模型标识。
        callback_url:
          type: string
          format: uri
          description: 可选的 Webhook URL，用于接收任务完成或失败通知。
        input:
          type: object
          additionalProperties: false
          properties:
            prompt:
              type: string
              maxLength: 5000
              description: 视频指令，最多 5,000 个字符。参考生视频时必填且不能为空；图生视频时可选。
            image_urls:
              type: array
              items:
                type: string
                format: uri
              minItems: 1
              maxItems: 1
              description: >-
                图生视频使用的起始帧图片，必须恰好一张。不能与 reference_image_urls 或
                reference_audio_urls 同时使用。请使用公开可访问的 HTTP 或 HTTPS URL。
            reference_image_urls:
              type: array
              items:
                type: string
                format: uri
              minItems: 1
              maxItems: 12
              description: >-
                参考生视频时必填。提供 1-12 张参考图片。不能与 image_urls 同时使用。请使用公开可访问的 HTTP 或
                HTTPS URL。
            reference_audio_urls:
              type: array
              items:
                type: string
                format: uri
              minItems: 1
              maxItems: 3
              description: >-
                配合 reference_image_urls 使用的可选参考音频。最多支持 3 个 MP3 文件，每个时长 3-12
                秒。没有参考图片时不能使用音频。请使用公开可访问的 HTTP 或 HTTPS URL。
            duration:
              type: integer
              minimum: 3
              maximum: 16
              default: 5
              description: 输出时长，单位为整秒。
            resolution:
              type: string
              enum:
                - 540p
                - 720p
                - 1080p
                - 2k
                - 4k
              default: 720p
              description: 输出视频分辨率。
            aspect_ratio:
              type: string
              enum:
                - '16:9'
                - '9:16'
                - '4:3'
                - '3:4'
                - '1:1'
              default: '16:9'
              description: 参考生视频的输出宽高比。图生视频时不要传此字段。
            generate_audio:
              type: boolean
              default: false
              description: 为参考生视频生成音轨。图生视频时不要传此字段。
            enable_safety_checker:
              type: boolean
              default: true
              description: 启用内容安全检查。
          description: >-
            提供一张 image_urls 起始帧，或提供 prompt 加 1-12 张
            reference_image_urls。参考音频可选，且需要配合参考图片使用。
          not:
            properties:
              image_urls:
                maxItems: 0
              reference_image_urls:
                maxItems: 0
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
          description: >-
            业务状态码。`200` 表示成功，其他值都表示请求失败。请务必检查这个字段：部分参数校验错误会以 HTTP 200 返回，响应体里的
            `code` 为 `400`。


            - `200`：成功

            - `400`：请求参数无效

            - `401`：API Key 缺失或无效

            - `402`：积分不足

            - `403`：没有权限

            - `404`：资源不存在

            - `408`：请求超时

            - `429`：请求频率超限

            - `500`：服务器内部错误

            - `502`：上游服务错误

            - `503`：服务暂不可用


            详见[错误码](/zh/api-manual/error-codes)。
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1792190000-example
            status:
              type: string
              enum:
                - not_started
                - running
                - finished
                - failed
              example: not_started
              description: >-
                任务状态。提交后立即返回时始终为
                `not_started`。后续状态请通过[查询任务状态](/zh/api-manual/task-management/status)接口或
                `callback_url` 获取。


                - `not_started`：排队中，等待处理

                - `running`：生成中

                - `finished`：已完成，结果在 `files` 或 `output` 中

                - `failed`：失败，详情见 `error_message`
            created_time:
              type: string
              format: date-time
              example: '2026-10-17T10:30:00'
    ErrorResponse:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: integer
          example: 400
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
          description: >-
            业务状态码。`200` 表示成功，其他值都表示请求失败。请务必检查这个字段：部分参数校验错误会以 HTTP 200 返回，响应体里的
            `code` 为 `400`。


            - `200`：成功

            - `400`：请求参数无效

            - `401`：API Key 缺失或无效

            - `402`：积分不足

            - `403`：没有权限

            - `404`：资源不存在

            - `408`：请求超时

            - `429`：请求频率超限

            - `500`：服务器内部错误

            - `502`：上游服务错误

            - `503`：服务暂不可用


            详见[错误码](/zh/api-manual/error-codes)。
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: invalid_request_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        所有 API 接口都需要 Bearer Token 认证。


        创建 API Key：登录 PoYo，进入 **仪表盘 → API
        密钥**（[poyo.ai/zh/dashboard/api-key](https://poyo.ai/zh/dashboard/api-key)），点击创建
        Key。


        在请求头中添加：


        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.