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

# VideoRetalk 声动人像

> - 音频驱动视频口型生成，将视频中人物的口型替换为与目标音频匹配的口型
- 异步处理模式，使用返回的任务ID [进行查询](/cn/api-manual/task-management/get-task-detail)
- 生成的视频链接有效期为24小时，请尽快保存

**典型应用场景：**
- 多语言配音：将原始视频的口型替换为其他语言的配音
- 虚拟主播：用 TTS 生成的音频驱动人物视频
- 广告制作：同一视频素材快速生成不同语种的广告版本
- 教育培训：将讲师视频替换为不同语言的讲解

**注意事项：**
- 输入 URL 必须公网可访问
- 视频中必须有人脸，否则任务会失败
- 多人脸场景务必传 `ref_image_url`



## OpenAPI

````yaml cn/api-manual/video-series/videoretalk/videoretalk-video-generate.json POST /v1/videos/generations
openapi: 3.1.0
info:
  title: VideoRetalk 声动人像接口
  description: 音频驱动视频口型生成。输入人物说话视频和目标音频，将视频中人物的口型替换为与目标音频匹配的口型。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 生产环境
security:
  - bearerAuth: []
tags:
  - name: 声动人像
    description: VideoRetalk 声动人像视频生成相关接口
paths:
  /v1/videos/generations:
    post:
      tags:
        - 声动人像
      summary: VideoRetalk 声动人像视频生成
      description: >-
        - 音频驱动视频口型生成，将视频中人物的口型替换为与目标音频匹配的口型

        - 异步处理模式，使用返回的任务ID
        [进行查询](/cn/api-manual/task-management/get-task-detail)

        - 生成的视频链接有效期为24小时，请尽快保存


        **典型应用场景：**

        - 多语言配音：将原始视频的口型替换为其他语言的配音

        - 虚拟主播：用 TTS 生成的音频驱动人物视频

        - 广告制作：同一视频素材快速生成不同语种的广告版本

        - 教育培训：将讲师视频替换为不同语言的讲解


        **注意事项：**

        - 输入 URL 必须公网可访问

        - 视频中必须有人脸，否则任务会失败

        - 多人脸场景务必传 `ref_image_url`
      operationId: createVideoRetalkGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoRetalkRequest'
            examples:
              minimal:
                summary: 最简调用
                value:
                  model: videoretalk
                  video_url: https://example.com/speaker.mp4
                  audio_url: https://example.com/target-speech.wav
              multi_face:
                summary: 多人脸场景 + 视频扩展
                value:
                  model: videoretalk
                  video_url: https://example.com/two-people-talking.mp4
                  audio_url: https://example.com/long-speech.wav
                  ref_image_url: https://example.com/target-person-face.jpg
                  video_extension: true
                  query_face_threshold: 150
              adjust_threshold:
                summary: 调整人脸匹配灵敏度
                value:
                  model: videoretalk
                  video_url: https://example.com/speaker.mp4
                  audio_url: https://example.com/speech.wav
                  query_face_threshold: 140
      responses:
        '200':
          description: 声动人像视频生成任务创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoRetalkResponse'
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: missing_required_params
                  message: 'Missing required parameter: video_url or audio_url'
                  type: invalid_request_error
        '401':
          description: 未认证、Token无效或过期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: 配额不足、需要充值
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: 无权限访问
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: 'Token does not have access to model: videoretalk'
                  type: invalid_request_error
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    VideoRetalkRequest:
      type: object
      required:
        - model
        - video_url
        - audio_url
      properties:
        model:
          type: string
          description: 模型名称
          enum:
            - videoretalk
          default: videoretalk
          example: videoretalk
        video_url:
          type: string
          format: uri
          description: |-
            输入视频URL，包含需要替换口型的人物

            **要求：**
            - 公网可访问的视频URL
            - 格式：MP4、MOV 等常见格式
            - 视频中需包含清晰可见的人脸
            - 建议时长：`2` ~ `300` 秒
          example: https://example.com/speaker.mp4
        audio_url:
          type: string
          format: uri
          description: |-
            目标音频URL，视频人物将按此音频说话

            **要求：**
            - 公网可访问的音频URL
            - 格式：WAV、MP3、M4A 等常见格式
            - 建议为人声说话内容
          example: https://example.com/target-speech.wav
        ref_image_url:
          type: string
          format: uri
          description: |-
            人脸参考图URL

            视频中有**多张人脸**时，用此图指定要替换口型的目标人脸

            **要求：**
            - 图片应包含目标人物的正脸
            - 仅在视频中有多张人脸时需要
          example: https://example.com/target-person-face.jpg
        video_extension:
          type: boolean
          description: |-
            当音频时长 > 视频时长时，是否自动扩展视频到音频长度

            - `true`：输出时长 = 音频时长（视频自动扩展）
            - `false`：输出时长 = min(视频时长, 音频时长)
          default: false
          example: false
        query_face_threshold:
          type: integer
          description: |-
            人脸匹配置信度阈值

            - 范围：`120` ~ `200`
            - 值越低越容易匹配（可能误匹配）
            - 值越高越严格（可能匹配不到）
            - 如果报「未找到匹配人脸」，可适当降低（如 `140`）
            - 如果匹配到错误人脸，可适当提高（如 `190`）
          default: 170
          minimum: 120
          maximum: 200
          example: 170
        callback_url:
          type: string
          description: |-
            任务完成后的HTTPS回调地址

            **回调时机：**
            - 任务完成（completed）、失败（failed）或取消（cancelled）时触发
            - 在计费确认完成后发送

            **安全限制：**
            - 仅支持HTTPS协议
            - 禁止回调到内网IP地址（127.0.0.1、10.x.x.x、172.16-31.x.x、192.168.x.x等）
            - URL长度不超过`2048`字符

            **回调机制：**
            - 超时时间：`10`秒
            - 失败后最多重试`3`次（会分别在失败的`1`秒/`2`秒/`4`秒后进行重试）
            - 回调响应体格式与任务查询接口返回的格式一致
            - 回调地址若返回2xx状态码视为成功，其他状态码会触发重试
          format: uri
          example: https://your-domain.com/webhooks/video-task-completed
    VideoRetalkResponse:
      type: object
      properties:
        created:
          type: integer
          description: 任务创建时间戳
          example: 1775200000
        id:
          type: string
          description: 任务ID
          example: task-unified-1775200000-xyz12345
        model:
          type: string
          description: 实际使用的模型名称
          example: videoretalk
        object:
          type: string
          enum:
            - video.generation.task
          description: 任务的具体类型
        progress:
          type: integer
          description: 任务进度百分比 (0-100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: |-
            任务状态

            | 状态 | progress | 说明 |
            |------|----------|------|
            | `pending` | 0~10 | 等待处理 |
            | `processing` | 10~80 | 处理中 |
            | `completed` | 100 | 完成 |
            | `failed` | 0 | 失败 |
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          $ref: '#/components/schemas/VideoTaskInfo'
          description: 视频任务详细信息
        type:
          type: string
          enum:
            - video
          description: 任务的输出类型
          example: video
        usage:
          $ref: '#/components/schemas/VideoUsage'
          description: 使用量和计费信息
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: 错误代码标识符
            message:
              type: string
              description: 错误描述信息
            type:
              type: string
              description: 错误类型
    VideoTaskInfo:
      type: object
      properties:
        can_cancel:
          type: boolean
          description: 任务是否可以取消
          example: false
        estimated_time:
          type: integer
          description: 预估完成时间(秒)
          minimum: 0
          example: 90
        video_duration:
          type: integer
          description: 预估视频时长(秒)
          example: 0
    VideoUsage:
      type: object
      description: 使用量信息
      properties:
        billing_rule:
          type: string
          description: 计费规则
          enum:
            - per_second
          example: per_second
        credits_reserved:
          type: number
          description: 预估消耗积分数（基于视频和音频时长）
          minimum: 0
          example: 480
        user_group:
          type: string
          description: 用户组类别
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##所有接口均需要使用Bearer Token进行认证##

        **获取 API Key：**

        访问 [API Key 管理页面](https://evolink.ai/dashboard/keys) 获取您的 API Key

        **使用时在请求头中添加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````