对口型

POST /kling/v1/videos/lip-sync

MethodPOST
Path/kling/v1/videos/lip-sync
Typehttp
Status1
Module2102810
Folder46920504

说明

1、生成视频 2、此接口要求视频id或视频url 使用视频id,需要在父任务账号上使用,请尽快操作避免资源包过期。 官方文档:https://app.klingai.com/cn/dev/document-api/apiReference/model/videoTolip

系统提供多种音色可供选择,具体音色效果、音色ID、音色语种对应关系点此查看

概览

MethodPOST
Path/kling/v1/videos/lip-sync
Typehttp
Status1
Module2102810
Folder46920504

参数

{
  "query": [],
  "path": [],
  "cookie": [],
  "header": [
    {
      "id": "NQs7bxnpZf",
      "name": "Content-Type",
      "required": true,
      "description": "",
      "type": "string",
      "enable": true,
      "sampleValue": "application/json"
    },
    {
      "id": "qb8tEQbCty",
      "name": "Accept",
      "required": true,
      "description": "",
      "type": "string",
      "enable": true,
      "sampleValue": "application/json"
    },
    {
      "required": true,
      "description": "",
      "type": "string",
      "id": "gBxcCbXhsa",
      "enable": true,
      "name": "Authorization",
      "sampleValue": "Bearer {{YOUR_API_KEY}}"
    }
  ]
}

请求体

{
  "type": "application/json",
  "parameters": [],
  "jsonSchema": {
    "type": "object",
    "properties": {
      "input": {
        "type": "object",
        "properties": {
          "video_id": {
            "description": "通过可灵AI生成的视频的ID",
            "type": "string"
          },
          "video_url": {
            "description": "所上传视频的获取链接,与input·video_id参数二选一填写,不能同时为空,也不能同时有值",
            "type": "string"
          },
          "mode": {
            "type": "string",
            "description": "生成视频的模式",
            "enum": [
              "std",
              "pro"
            ],
            "x-apifox-enum": [
              {
                "value": "std",
                "name": "标准模式",
                "description": "基础模式,性价比高"
              },
              {
                "value": "pro",
                "name": "专家模式",
                "description": "高表现模式,生成视频质量更佳"
              }
            ]
          },
          "text": {
            "type": "string",
            "description": "合成音频的文案"
          },
          "voice_id": {
            "type": "string",
            "description": "音色ID"
          },
          "voice_language": {
            "type": "string",
            "description": "音色语种,与音色ID对应",
            "enum": [
              "zh",
              "en"
            ],
            "x-apifox-enum": [
              {
                "value": "zh",
                "name": "",
                "description": ""
              },
              {
                "value": "en",
                "name": "",
                "description": ""
              }
            ]
          }
        },
        "required": [
          "mode",
          "text",
          "voice_id",
          "voice_language",
          "video_id",
          "video_url"
        ],
        "x-apifox-orders": [
          "video_id",
          "video_url",
          "mode",
          "text",
          "voice_id",
          "voice_language"
        ]
      }
    },
    "x-apifox-orders": [
      "input"
    ],
    "required": [
      "input"
    ]
  },
  "required": false,
  "mediaType": "",
  "examples": [
    {
      "value": "{\n    \"input\":{\n        \"video_id\":\"827964097668337738\",//通过可灵AI生成的视频的ID\n        // \"video_url\": \"https://xxxxxxx.mp4\", //所上传视频的获取链接,与input·video_id参数二选一填写,不能同时为空,也不能同时有值\n        \"mode\":\"text2video\",\n        \"text\":\"今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好\",\n        \"voice_id\":\"girlfriend_1_speech02\",\n        \"voice_language\":\"zh\"\n    }\n}",
      "mediaType": "application/json",
      "description": ""
    }
  ],
  "oasExtensions": ""
}

响应

[
  {
    "id": 808523352,
    "name": "成功",
    "code": 200,
    "contentType": "json",
    "jsonSchema": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        },
        "request_id": {
          "type": "string"
        },
        "data": {
          "type": "object",
          "properties": {
            "task_id": {
              "type": "string"
            },
            "task_status": {
              "type": "string"
            },
            "task_info": {
              "type": "object",
              "properties": {}
            },
            "created_at": {
              "type": "integer"
            },
            "updated_at": {
              "type": "integer"
            }
          },
          "required": [
            "task_id",
            "task_status",
            "task_info",
            "created_at",
            "updated_at"
          ]
        }
      },
      "required": [
        "code",
        "message",
        "request_id",
        "data"
      ]
    },
    "itemSchema": {},
    "description": "",
    "mediaType": "",
    "headers": [],
    "oasExtensions": ""
  }
]

响应示例

[
  {
    "name": "成功示例",
    "responseId": 808523352,
    "data": "{\r\n    \"code\": 0,\r\n    \"message\": \"SUCCEED\",\r\n    \"request_id\": \"38905f60-e76c-4f77-adb3-867a5b67d41e\",\r\n    \"data\": {\r\n        \"task_id\": \"817067112967086149\",\r\n        \"task_status\": \"submitted\",\r\n        \"created_at\": 1762832498885,\r\n        \"updated_at\": 1762832498885\r\n    }\r\n}",
    "description": "",
    "oasKey": "",
    "oasExtensions": "",
    "id": 724021072
  }
]