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

# Crun Vidu 对口型 API

> 借助Vidu口型同步功能、音频驱动唇形同步技术，对已有视频进行音频替换或配音。只需提供一段视频以及新的音频或文本，该工具就能重新渲染说话人的唇部动作，实现音画匹配。

## 查询任务状态

提交任务后，请使用统一查询接口查看进度并获取结果：

<Card title="获取任务信息" icon="magnifying-glass" href="/zh/models/common/get-task-info">
  了解如何查询任务状态并获取生成结果
</Card>

<Tip>
  生产环境中，建议使用 `callback_url` 参数接收任务完成后的自动通知，而不是轮询状态接口。
</Tip>

## 相关资源

<CardGroup cols={2}>
  <Card title="模型概览" icon="store" href="/zh/models/quickstart">
    查看所有可用模型
  </Card>

  <Card title="通用 API" icon="gear" href="/zh/common-api/get-account-credits">
    查询账户剩余积分
  </Card>
</CardGroup>


## OpenAPI

````yaml zh/models/vidu/lip-sync.json post /api/v1/client/job/CreateTask
openapi: 3.0.0
info:
  title: Crun Vidu 对口型 API
  description: crun.ai Vidu 对口型 API 文档
  version: 1.0.0
  contact:
    name: 技术支持
    email: support@crun.ai
servers:
  - url: https://api.crun.ai
    description: API 服务器
security:
  - ApiKeyAuth: []
paths:
  /api/v1/client/job/CreateTask:
    post:
      summary: vidu 对口型生成
      operationId: vidu/lip-sync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - vidu/lip-sync
                  description: |-
                    用于生成的模型名称，必填字段。

                    - 使用本端点时必须填写 `vidu/lip-sync`
                callback_url:
                  type: string
                  format: uri
                  description: |-
                    可选。用于接收任务完成通知的回调 URL。

                    - 生成完成后，系统将以 POST 方式向该 URL 推送任务状态与结果
                    - 回调数据结构与任务状态查询接口返回的 `data` 对象一致
                    - 您的回调端点需支持接收包含结果的 JSON 格式 POST 请求
                    - 成功接收后需返回 HTTP 200 状态码
                  example: https://your-domain.com/api/callback
                input:
                  type: object
                  description: Vidu 口型同步模型的输入参数。
                  properties:
                    video_url:
                      type: string
                      format: uri
                      description: |-
                        源视频 URL。
                        注意1：仅支持以下视频格式：mp4、mov、avi；
                        注意2：支持时长范围为 1 至 600 秒，推荐时长为 10 至 120 秒；
                      example: https://example.com/video.mp4
                    audio_url:
                      type: string
                      format: uri
                      nullable: true
                      description: 音频 URL。口型同步视频所使用的文字内容和音色以该音频文件为准。不可与 `text` 同时使用。
                      example: https://example.com/audio.mp3
                    text:
                      type: string
                      nullable: true
                      description: >-
                        用于语音生成的文字内容。用于口型同步视频生成的文字内容，不少于 4 个字符，不超过 2000 个字符（中文 2
                        至 1000 字，英文 4 至 2000 字符）。不可与 `audio_url` 同时使用。
                      minLength: 2
                      maxLength: 2000
                      example: Hello everyone, welcome to our demo.
                    voice_id:
                      type: string
                      nullable: true
                      description: >-
                        文字转语音所使用的音色 ID，使用 `text` 时必填。参考：[Vidu 音色 ID
                        列表](https://shengshu.feishu.cn/sheets/EgFvs6DShhiEBStmjzccr5gonOg)
                      example: male-qn-qingse
                    speed:
                      type: number
                      nullable: true
                      description: >-
                        语速倍率。1.0 表示正常语速，取值范围为 [0.5, 2]。值为 0.5 时播放速度最慢，值为 2
                        时播放速度最快。仅在使用 `text` 生成时有效。
                      minimum: 0.5
                      maximum: 2
                      example: 1
                    volume:
                      type: integer
                      nullable: true
                      description: 语音音量级别。0 表示正常音量，值越大音量越高。仅在使用 `text` 生成时有效。
                      minimum: 0
                      maximum: 10
                      example: 5
                    moderation:
                      type: string
                      description: >-
                        内容审核开关。使用 `enabled` 启用审核，使用 `disabled` 关闭审核。默认值为
                        `enabled`。
                      enum:
                        - disabled
                        - enabled
                      default: enabled
                      example: enabled
                  required:
                    - video_url
            example:
              model: vidu/lip-sync
              input:
                video_url: https://example.com/video.mp4
                text: Hello everyone, welcome to Crun AI.
                voice_id: male-qn-qingse
                speed: 1
                volume: 5
                moderation: enabled
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          task_id:
                            type: string
                            description: 任务 ID，可通过获取任务详情接口查询任务状态
                            example: task_12345678
              example:
                code: 200
                message: success
                data:
                  task_id: task_12345678
        '422':
          description: 验证错误
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      errors:
                        type: array
                        description: 详细的验证错误信息
                        items:
                          type: string
                        example:
                          - specific error field message
              example:
                code: 422
                message: Missing Params or Type Error
                errors:
                  - specific error field message
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          enum:
            - 200
            - 401
            - 402
            - 404
            - 422
            - 429
            - 455
            - 500
            - 501
            - 505
          description: |-
            响应状态码

            - **200**: 成功 - 请求已成功处理
            - **401**: 未授权 - 身份凭证缺失或无效
            - **402**: 额度不足 - 账户余额不足以完成本次操作
            - **404**: 未找到 - 请求的资源或端点不存在
            - **422**: 验证错误 - 请求参数未通过验证
            - **429**: 请求限速 - 该资源的请求次数已超出限制
            - **455**: 服务不可用 - 系统正在维护中
            - **500**: 服务器错误 - 处理请求时发生意外错误
            - **501**: 生成失败 - 内容生成任务失败
            - **505**: 功能已禁用 - 所请求的功能当前已被禁用
        message:
          type: string
          description: 响应消息，失败时为错误描述
          example: success
  responses:
    Error:
      description: 服务器错误
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: |-
        所有 API 均需通过 API Key 进行身份验证。

        获取 API Key：
        1. 访问 [API Key 管理页面](https://crun.ai/zh/user-api-key) 获取您的 API Key

        使用方式：
        将以下内容添加至请求头：

        x-api-key: YOUR_API_KEY

        注意事项：
        - 请妥善保管您的 API Key，切勿与他人共享
        - 若怀疑 API Key 已泄露，请立即在管理页面进行重置

````