Files
sionrui/docs/302keling.md
2025-12-01 22:27:50 +08:00

555 lines
20 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Identify-Face对口型-人脸识别)
## OpenAPI Specification
```yaml
openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/klingai/v1/videos/identify-face:
post:
summary: Identify-Face对口型-人脸识别)
deprecated: false
description: >-
【对口型】人脸识别
用于判断视频是否可用于对口型服务
视频支持.mp4/.mov文件大小不超过100MB视频时长不超过60s且不短于2s仅支持720p和1080p、长宽的边长均位于512px~2160px之间
**价格0.007 PTC/次**
tags:
- 视频生成/Kling可灵/官方格式
parameters:
- name: Authorization
in: header
description: ''
required: false
example: Bearer {{YOUR_API_KEY}}
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
video_url:
type: string
description: 视频URL
required:
- video_url
x-apifox-orders:
- video_url
example:
video_url: >-
https://v1-kling.kechuangai.com/bs2/upload-ylab-stunt/d13e3899-26f7-4246-89f2-ac36d93a45ec-XVyFFzU2buUdk85MAwVZow-outputn6w14.mp4?x-kcdn-pid=112452
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
code:
type: integer
description: 错误码
message:
type: string
description: 错误信息
request_id:
type: string
description: 请求ID系统生成用于跟踪请求、排查问题
data:
type: object
properties:
session_id:
type: string
description: 会话ID会基于视频初始化任务生成不会随编辑选区行为而改变有效期24小时
face_data:
type: array
items:
type: object
properties:
face_id:
type: string
description: 视频中的人脸ID同一个人脸在视频中间隔超过1s时会视作不同ID
face_image:
type: string
description: 从视频中截图的人脸的示意图
start_time:
type: integer
description: 该人脸可对口型区间起点时间,可作为对口型最佳开始时间
end_time:
type: integer
description: 该人脸可对口型区间终点时间;注:此结果存在毫秒级误差,会长于实际区间终点
x-apifox-orders:
- face_id
- face_image
- start_time
- end_time
required:
- session_id
- face_data
x-apifox-orders:
- session_id
- face_data
required:
- code
- message
- request_id
- data
x-apifox-orders:
- code
- message
- request_id
- data
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 视频生成/Kling可灵/官方格式
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/4012774/apis/api-376485194-run
components:
schemas: {}
securitySchemes:
apiKeyAuth:
type: apikey
in: header
name: Authorization
servers:
- url: https://api.302.ai
description: 正式环境
- url: https://api.302ai.cn
description: 国内中转
security: []
```
# Advanced-Lip-Sync对口型-创建任务)
## OpenAPI Specification
```yaml
openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/klingai/v1/videos/advanced-lip-sync:
post:
summary: Advanced-Lip-Sync对口型-创建任务)
deprecated: false
description: >-
【对口型】创建任务
用于创建对口型任务
音频文件支持传入音频Base64编码或图音频URL确保可访问、支持.mp3/.wav/.m4a文件大小不超过5MB。仅支持使用时长不短于2秒且不长于60秒的音频
**价格0.07 PTC/次**
tags:
- 视频生成/Kling可灵/官方格式
parameters:
- name: Authorization
in: header
description: ''
required: false
example: Bearer {{YOUR_API_KEY}}
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
face_choose:
type: array
items:
type: object
properties:
face_id:
type: string
description: 由人脸识别接口返回
sound_file:
type: string
description: |-
支持传入音频Base64编码或图音频URL确保可访问
音频文件支持.mp3/.wav/.m4a文件大小不超过5MB格式不匹配或文件过大会返回错误码等信息
仅支持使用时长不短于2秒且不长于60秒的音频
sound_start_time:
type: integer
description: |-
音频裁剪起点时间
以原始音频开始时间为准开始时间为0分0秒单位ms
起点之前的音频会被裁剪裁剪后音频不得短于2秒
sound_end_time:
type: integer
description: |-
音频裁剪终点时间
以原始音频开始时间为准开始时间为0分0秒单位ms
终点之后的音频会被裁剪裁剪后音频不得短于2秒
终点时间不得晚于原始音频总时长
sound_insert_time:
type: integer
description: |-
剪后音频插入时间
以视频开始时间为准视频开始时间为0分0秒单位ms
插入音频的时间范围与该人脸可对口型时间区间至少重合2秒时长
插入音频的开始时间不得早于视频开始时间,插入音频的结束时间不得晚于视频结束时间
sound_volume:
type: number
description: |-
音频音量大小;值越大,音量越大
取值范围:[0, 2]
minimum: 0
maximum: 2
original_audio_volume:
type: number
description: |-
原始视频音量大小;值越大,音量越大
取值范围:[0, 2]
原视频无声时,当前参数无效果
minimum: 0
maximum: 2
x-apifox-orders:
- face_id
- sound_file
- sound_start_time
- sound_end_time
- sound_insert_time
- sound_volume
- original_audio_volume
required:
- face_id
- sound_file
- sound_start_time
- sound_end_time
- sound_insert_time
session_id:
type: string
external_task_id:
type: string
description: |-
自定义任务ID
用户自定义任务ID传入不会覆盖系统生成的任务ID但支持通过该ID进行任务查询
请注意,单用户下需要保证唯一性
required:
- face_choose
- session_id
x-apifox-orders:
- session_id
- face_choose
- external_task_id
example:
session_id: ''
face_choose:
- face_id: 0
sound_file: >-
https://v1-kling.kechuangai.com/bs2/upload-ylab-stunt/minimax_tts/0522e64c8388bc83f7e72f39576f931b/audiowfegf.mp3?x-kcdn-pid=112452
sound_start_time: 0
sound_end_time: 3000
sound_insert_time: 0
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
code:
description: 错误码;具体定义见错误码
type: integer
message:
description: 错误信息
type: string
request_id:
description: 请求ID系统生成用于跟踪请求、排查问题
type: string
data:
type: object
properties:
task_id:
description: 任务ID系统生成
type: string
task_info:
type: object
properties:
external_task_id:
description: 客户自定义任务ID
type: string
description: 任务创建时的参数信息
x-apifox-orders:
- external_task_id
task_status:
type: string
description: 任务状态
enum:
- submitted
- processing
- succeed
- failed
x-apifox-enum:
- value: submitted
name: ''
description: ''
- value: processing
name: ''
description: ''
- value: succeed
name: ''
description: ''
- value: failed
name: ''
description: ''
created_at:
description: 任务创建时间Unix时间戳、单位ms
type: integer
updated_at:
description: 任务更新时间Unix时间戳、单位ms
type: integer
required:
- task_id
- task_info
- task_status
- created_at
- updated_at
x-apifox-orders:
- task_id
- task_info
- task_status
- created_at
- updated_at
required:
- code
- message
- request_id
- data
x-apifox-orders:
- code
- message
- request_id
- data
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 视频生成/Kling可灵/官方格式
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/4012774/apis/api-379714705-run
components:
schemas: {}
securitySchemes:
apiKeyAuth:
type: apikey
in: header
name: Authorization
servers:
- url: https://api.302.ai
description: 正式环境
- url: https://api.302ai.cn
description: 国内中转
security: []
```
# Advanced-Lip-Sync对口型-查询任务)
## OpenAPI Specification
```yaml
openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/klingai/v1/videos/advanced-lip-sync/{id}:
get:
summary: Advanced-Lip-Sync对口型-查询任务)
deprecated: false
description: |-
【对口型】任务查询
用于查询单个任务的视频结果
**价格0 PTC/次**
tags:
- 视频生成/Kling可灵/官方格式
parameters:
- name: id
in: path
description: 对口型的task_id
required: true
schema:
type: string
- name: Authorization
in: header
description: ''
required: false
example: Bearer {{YOUR_API_KEY}}
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
code:
description: 错误码
type: integer
message:
description: 错误信息
type: string
request_id:
description: 请求ID系统生成用于跟踪请求、排查问题全局唯一
type: string
data:
type: object
properties:
task_id:
description: 任务ID系统生成全局唯一
type: string
task_status:
type: string
description: 任务状态
enum:
- submitted
- processing
- succeed
- failed
x-apifox-enum:
- value: submitted
name: ''
description: ''
- value: processing
name: ''
description: ''
- value: succeed
name: ''
description: ''
- value: failed
name: ''
description: ''
task_status_msg:
description: 任务状态信息,当任务失败时展示失败原因(如触发平台的内容风控等)
type: string
task_info:
type: object
properties:
parent_video:
type: object
properties:
id:
description: 原视频ID全局唯一
type: string
url:
description: 原视频的URL请注意为保障信息安全生成的图片/视频会在30天后被清理请及时转存
type: string
duration:
description: 原视频总时长单位s
type: string
required:
- id
- url
- duration
x-apifox-orders:
- id
- url
- duration
required:
- parent_video
description: 任务创建时的参数信息
x-apifox-orders:
- parent_video
task_result:
type: object
properties:
videos:
type: array
items:
type: object
properties:
id:
description: 视频ID全局唯一
type: string
url:
description: >-
对口型视频的URL请注意为保障信息安全生成的图片/视频会在30天后被清理请及时转存
type: string
duration:
description: 对口型视频总时长单位s
type: string
x-apifox-orders:
- id
- url
- duration
description: 数组是为了保留扩展性以防未来要支持n
required:
- videos
x-apifox-orders:
- videos
created_at:
description: 任务创建时间Unix时间戳、单位ms
type: integer
updated_at:
description: 任务更新时间Unix时间戳、单位ms
type: integer
required:
- task_id
- task_status
- task_status_msg
- task_info
- task_result
- created_at
- updated_at
x-apifox-orders:
- task_id
- task_status
- task_status_msg
- task_info
- task_result
- created_at
- updated_at
required:
- code
- message
- request_id
- data
x-apifox-orders:
- code
- message
- request_id
- data
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 视频生成/Kling可灵/官方格式
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/4012774/apis/api-381810693-run
components:
schemas: {}
securitySchemes:
apiKeyAuth:
type: apikey
in: header
name: Authorization
servers:
- url: https://api.302.ai
description: 正式环境
- url: https://api.302ai.cn
description: 国内中转
security: []
```