Loading...
Loading...
Compare original and translation side by side
access_tokenfile_idfile_idaccess_tokenfile_idfile_idPOST /open/v1/access_token
Content-Type: application/json{
"app_id": "84042cb5",
"secret_key": "10cd5091fe6042dfb91ba01816a991e0"
}{
"trace_id": "8ff3fcd57b33566048ef28568c6cee96",
"code": 0,
"msg": "success",
"data": {
"access_token": "1208CuZcV1Vlzj8MxqbO0kd1Wcl4yxwoHl6pYIzvAGoP3DpwmCCa73zmgR5NCrNu",
"expire_in": 1721289220
}
}| First-level Field | Second-level Field | Description |
|---|---|---|
| code | Response status code | |
| msg | Response message | |
| data | Response data | |
| access_token | Valid for one day, previous token will be invalidated | |
| expire_in | Token expiration time |
| Code | Description |
|---|---|
| 0 | Success |
| 400 | Invalid parameter format |
| 40000 | Parameter error |
| 50000 | System internal error |
POST /open/v1/access_token
Content-Type: application/json{
"app_id": "84042cb5",
"secret_key": "10cd5091fe6042dfb91ba01816a991e0"
}{
"trace_id": "8ff3fcd57b33566048ef28568c6cee96",
"code": 0,
"msg": "success",
"data": {
"access_token": "1208CuZcV1Vlzj8MxqbO0kd1Wcl4yxwoHl6pYIzvAGoP3DpwmCCa73zmgR5NCrNu",
"expire_in": 1721289220
}
}| 一级字段 | 二级字段 | 说明 |
|---|---|---|
| code | 响应状态码 | |
| msg | 响应消息 | |
| data | 响应数据 | |
| access_token | 有效期为一天,旧令牌将失效 | |
| expire_in | 令牌过期时间 |
| 状态码 | 说明 |
|---|---|
| 0 | 成功 |
| 400 | 参数格式无效 |
| 40000 | 参数错误 |
| 50000 | 系统内部错误 |
file_id[File Management](https://doc.chanjing.cc/api/file/file-management.html)file_id[文件管理](https://doc.chanjing.cc/api/file/file-management.html)GET /open/v1/common/create_upload_url
access_token: {{access_token}}| Key | Example | Description |
|---|---|---|
| service | lip_sync_video / lip_sync_audio | File usage purpose. Use |
| name | 1.mp4 | Original file name including extension |
sign_urlmime_typefile_idsign_urlPUTContent-Typemime_typefile_idvideo_file_idaudio_file_idGET /open/v1/common/create_upload_url
access_token: {{access_token}}| 键 | 示例 | 说明 |
|---|---|---|
| service | lip_sync_video / lip_sync_audio | 文件使用场景。驱动视频使用 |
| name | 1.mp4 | 包含扩展名的原始文件名 |
sign_urlmime_typefile_idsign_urlPUTContent-Typemime_typefile_idvideo_file_idaudio_file_idPOST /open/v1/video_lip_sync/create
access_token: {{access_token}}
Content-Type: application/json{
"video_file_id": "e284db4d95de4220afe78132158156b5",
"screen_width": 1080,
"screen_height": 1920,
"callback": "https://example.com/openapi/callback",
"model": 0,
"audio_type": "tts",
"tts_config": {
"text": "君不见黄河之水天上来,奔流到海不复回。",
"audio_man_id": "C-f2429d07554749839849497589199916",
"speed": 1,
"pitch": 1
}
}{
"video_file_id": "e284db4d95de4220afe78132158156b5",
"screen_width": 1080,
"screen_height": 1920,
"model": 0,
"audio_type": "audio",
"audio_file_id": "audio_file_id_from_file_management"
}| Parameter Name | Type | Required | Description |
|---|---|---|---|
| video_file_id | string | Yes | Video file ID from File Management ( |
| screen_width | int | No | Screen width, default 1080 |
| screen_height | int | No | Screen height, default 1920 |
| backway | int | No | Playback order when reaching end: 1-normal, 2-reverse. Default 1 |
| drive_mode | string | No | Drive mode: ""-normal, "random"-random frame. Default "" |
| callback | string | No | Callback URL for async notification |
| model | int | No | Model version: 0-basic, 1-high quality. Default 0 |
| audio_type | string | No | Audio type: "tts"-text driven, "audio"-audio driven. Default "tts" |
| tts_config | object | Yes (for tts) | TTS configuration when audio_type="tts" |
| tts_config.text | string | Yes (for tts) | Text to synthesize |
| tts_config.audio_man_id | string | Yes (for tts) | Voice ID |
| tts_config.speed | number | No | Speech speed: 0.5-2, default 1 |
| tts_config.pitch | number | No | Pitch, default 1 |
| audio_file_id | string | Yes (for audio) | Audio file ID from File Management ( |
| volume | int | No | Volume: 1-100, default 100 |
{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": "9499ed79995c4bdb95f0d66ca84419fd"
}| Field | Description |
|---|---|
| code | Response status code |
| msg | Response message |
| data | Video ID for subsequent polling |
POST /open/v1/video_lip_sync/create
access_token: {{access_token}}
Content-Type: application/json{
"video_file_id": "e284db4d95de4220afe78132158156b5",
"screen_width": 1080,
"screen_height": 1920,
"callback": "https://example.com/openapi/callback",
"model": 0,
"audio_type": "tts",
"tts_config": {
"text": "君不见黄河之水天上来,奔流到海不复回。",
"audio_man_id": "C-f2429d07554749839849497589199916",
"speed": 1,
"pitch": 1
}
}{
"video_file_id": "e284db4d95de4220afe78132158156b5",
"screen_width": 1080,
"screen_height": 1920,
"model": 0,
"audio_type": "audio",
"audio_file_id": "audio_file_id_from_file_management"
}| 参数名 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| video_file_id | string | 是 | 文件管理API返回的视频文件ID( |
| screen_width | int | 否 | 屏幕宽度,默认值1080 |
| screen_height | int | 否 | 屏幕高度,默认值1920 |
| backway | int | 否 | 播放到结尾时的播放顺序:1-正常,2-反向。默认值1 |
| drive_mode | string | 否 | 驱动模式:""-正常,"random"-随机帧。默认值"" |
| callback | string | 否 | 异步通知的回调URL |
| model | int | 否 | 模型版本:0-基础版,1-高品质版。默认值0 |
| audio_type | string | 否 | 音频类型:"tts"-文本驱动,"audio"-音频驱动。默认值"tts" |
| tts_config | object | 是(当audio_type为tts时) | 当audio_type="tts"时的TTS配置 |
| tts_config.text | string | 是(当audio_type为tts时) | 待合成的文本 |
| tts_config.audio_man_id | string | 是(当audio_type为tts时) | 语音ID |
| tts_config.speed | number | 否 | 语速:0.5-2,默认值1 |
| tts_config.pitch | number | 否 | 音调,默认值1 |
| audio_file_id | string | 是(当audio_type为audio时) | 当 |
| volume | int | 否 | 音量:1-100,默认值100 |
{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": "9499ed79995c4bdb95f0d66ca84419fd"
}| 字段 | 说明 |
|---|---|
| code | 响应状态码 |
| msg | 响应消息 |
| data | 用于后续轮询的视频ID |
POST /open/v1/video_lip_sync/list
access_token: {{access_token}}
Content-Type: application/json{
"page": 1,
"page_size": 10
}| Parameter | Type | Required | Description |
|---|---|---|---|
| page | int | No | Page number, default 1 |
| page_size | int | No | Page size, default 10 |
{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": {
"list": [
{
"id": "9499ed79995c4bdb95f0d66ca84419fd",
"status": 20,
"progress": 100,
"msg": "success",
"video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
"preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
"duration": 300,
"create_time": 1738636800
}
],
"page_info": {
"page": 1,
"size": 10,
"total_count": 1,
"total_page": 1
}
}
}| First-level Field | Second-level Field | Description |
|---|---|---|
| code | Response status code | |
| msg | Response message | |
| data | Response data | |
| list | Task list | |
| id: Video ID | ||
| status: Task status (0-pending, 10-generating, 20-success, 30-failed) | ||
| progress: Progress 0-100 | ||
| msg: Task message | ||
| video_url: Video download URL | ||
| preview_url: Cover image URL | ||
| duration: Video duration in ms | ||
| create_time: Creation time (unix timestamp) | ||
| page_info | Pagination info |
POST /open/v1/video_lip_sync/list
access_token: {{access_token}}
Content-Type: application/json{
"page": 1,
"page_size": 10
}| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| page | int | 否 | 页码,默认值1 |
| page_size | int | 否 | 每页数量,默认值10 |
{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": {
"list": [
{
"id": "9499ed79995c4bdb95f0d66ca84419fd",
"status": 20,
"progress": 100,
"msg": "success",
"video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
"preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
"duration": 300,
"create_time": 1738636800
}
],
"page_info": {
"page": 1,
"size": 10,
"total_count": 1,
"total_page": 1
}
}
}| 一级字段 | 二级字段 | 说明 |
|---|---|---|
| code | 响应状态码 | |
| msg | 响应消息 | |
| data | 响应数据 | |
| list | 任务列表 | |
| id: 视频ID | ||
| status: 任务状态(0-待处理,10-生成中,20-成功,30-失败) | ||
| progress: 进度0-100 | ||
| msg: 任务消息 | ||
| video_url: 视频下载URL | ||
| preview_url: 封面图片URL | ||
| duration: 视频时长(毫秒) | ||
| create_time: 创建时间(Unix时间戳) | ||
| page_info | 分页信息 |
GET /open/v1/video_lip_sync/detail
access_token: {{access_token}}| Parameter | Description |
|---|---|
| id | Video ID |
GET /open/v1/video_lip_sync/detail?id=9499ed79995c4bdb95f0d66ca84419fd{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": {
"id": "9499ed79995c4bdb95f0d66ca84419fd",
"status": 20,
"progress": 100,
"msg": "success",
"video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
"preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
"duration": 300,
"create_time": 1738636800
}
}| First-level Field | Second-level Field | Description |
|---|---|---|
| code | Response status code | |
| msg | Response message | |
| data | Response data | |
| id | Video ID | |
| status | Task status: 0-pending, 10-generating, 20-success, 30-failed | |
| progress | Progress 0-100 | |
| msg | Task message | |
| video_url | Video download URL | |
| preview_url | Cover image URL | |
| duration | Video duration in ms | |
| create_time | Creation time (unix timestamp) |
GET /open/v1/video_lip_sync/detail
access_token: {{access_token}}| 参数 | 说明 |
|---|---|
| id | 视频ID |
GET /open/v1/video_lip_sync/detail?id=9499ed79995c4bdb95f0d66ca84419fd{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": {
"id": "9499ed79995c4bdb95f0d66ca84419fd",
"status": 20,
"progress": 100,
"msg": "success",
"video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
"preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
"duration": 300,
"create_time": 1738636800
}
}| 一级字段 | 二级字段 | 说明 |
|---|---|---|
| code | 响应状态码 | |
| msg | 响应消息 | |
| data | 响应数据 | |
| id | 视频ID | |
| status | 任务状态:0-待处理,10-生成中,20-成功,30-失败 | |
| progress | 进度0-100 | |
| msg | 任务消息 | |
| video_url | 视频下载URL | |
| preview_url | 封面图片URL | |
| duration | 视频时长(毫秒) | |
| create_time | 创建时间(Unix时间戳) |
{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": {
"id": "9499ed79995c4bdb95f0d66ca84419fd",
"status": 20,
"progress": 100,
"msg": "success",
"video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
"preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
"duration": 300,
"create_time": 1738636800
}
}{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": {
"id": "9499ed79995c4bdb95f0d66ca84419fd",
"status": 20,
"progress": 100,
"msg": "success",
"video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
"preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
"duration": 300,
"create_time": 1738636800
}
}| Code | Description |
|---|---|
| 0 | Response successful |
| 10400 | AccessToken verification failed |
| 40000 | Parameter error |
| 40001 | Exceeds RPM/QPS limit |
| 50000 | System internal error |
| 状态码 | 说明 |
|---|---|
| 0 | 响应成功 |
| 10400 | AccessToken验证失败 |
| 40000 | 参数错误 |
| 40001 | 超出RPM/QPS限制 |
| 50000 | 系统内部错误 |