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

# kling-lip-sync

> 创建对口型视频生成异步任务。视频中人物的嘴型将与提供的语音内容对齐。

**前置条件**：必须先调用 `identify-face` 接口获取 `session_id`。

支持两种输入方式：
- **文本模式**：提供 `text`、`voice_id`、`voice_language`，平台内置 TTS 合成语音并驱动嘴型。
- **音频模式**：提供 `audio_url`，直接用已有音频文件驱动嘴型。

提交后轮询 `GET /kling/v1/videos/advanced-lip-sync/{task_id}` 直到 `status` 为 `succeeded`。


<Card title="音色 ID 参考文档" icon="volume" href="https://docs.qingque.cn/s/home/eZQDvafJ4vXQkP8T9ZPvmye8S?identityId=2E1MlYrrPk4">
  在线试听所有可用音色，选择适合的 voice\_id 参数值。
</Card>


## OpenAPI

````yaml zh/api-reference/model-api/kuaishou/openapi/kling-lip-sync/openapi.yaml POST /kling/v1/videos/advanced-lip-sync
openapi: 3.1.0
info:
  title: Kling 对口型生成
  description: 驱动视频中人物的嘴型匹配文本（TTS）或音频文件中的语音
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /kling/v1/videos/advanced-lip-sync:
    post:
      summary: 创建对口型任务
      description: >
        创建对口型视频生成异步任务。视频中人物的嘴型将与提供的语音内容对齐。


        **前置条件**：必须先调用 `identify-face` 接口获取 `session_id`。


        支持两种输入方式：

        - **文本模式**：提供 `text`、`voice_id`、`voice_language`，平台内置 TTS 合成语音并驱动嘴型。

        - **音频模式**：提供 `audio_url`，直接用已有音频文件驱动嘴型。


        提交后轮询 `GET /kling/v1/videos/advanced-lip-sync/{task_id}` 直到 `status` 为
        `succeeded`。
      operationId: klingAdvancedLipSyncZh
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - input
              properties:
                input:
                  type: object
                  required:
                    - session_id
                  properties:
                    session_id:
                      type: string
                      description: 人脸识别接口返回的会话 ID。
                      example: abc123-session-id
                    face_image_url:
                      type: string
                      description: 人脸参考图片 URL（可选，用于提升人物一致性）。
                    text:
                      type: string
                      description: |
                        人物要说的文字内容（文本模式）。与 `audio_url` 二选一。
                      example: 你好，欢迎来到我的频道
                    voice_id:
                      type: string
                      description: TTS 音色 ID（文本模式必填）。
                      example: girlfriend_1_cn
                    voice_language:
                      type: string
                      description: 语言代码（文本模式必填）。
                      enum:
                        - zh
                        - en
                      example: zh
                    audio_url:
                      type: string
                      description: |
                        音频文件的公网 URL（音频模式）。与 `text` 二选一。
                      example: https://example.com/speech.mp3
      responses:
        '200':
          description: 对口型任务已创建
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: 任务 ID
                    example: task_abc123
                  task_id:
                    type: string
                    description: 任务 ID（同 id）
                    example: task_abc123
                  object:
                    type: string
                    example: video
                  model:
                    type: string
                    example: kling-lip-sync
                  status:
                    type: string
                    description: 初始为空，通过查询接口获取最新状态。
                    example: ''
                  progress:
                    type: integer
                    description: 进度 0–100
                    example: 0
                  created_at:
                    type: integer
                    description: Unix 时间戳
                    example: 1773812605
        '400':
          description: 请求参数有误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````