VersionUpdate TimeStatusAuthorDescription

v2025-03-23 19:01:42

2025-03-23 19:01:42

auto

@zhaoliang

Created by smart-doc

1.作品相关API

1.1.创建作品

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 创建作品

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

audioUrl

string

音频文件地址,音频驱动时必填,支持 mp3、m4a、wav 等格式,100M 以内,时长范围 5 秒 ~ 30 分钟

true

-

videoUrl

string

视频文件地址,视频驱动必填,支持 mp4、mov 格式且使用 h264 编码,500MB 以内,分辨率范围 360p ~ 4K,时长范围 10 秒~ 300秒。注意:相同 URL 视为同一个数字人。

true

-

text

string

文本内容,文本驱动/输出仅音频时必填,不超过 10000 字

false

-

title

string

作品名称,默认"未命名",不超过 20 个字。

false

-

callbackUrl

string

回调地址

false

-

newAudioUrl

string

转储文件地址 (不需传)

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/works/create' --data '{
  "audioUrl": "",
  "videoUrl": "",
  "text": "",
  "title": "",
  "callbackUrl": "",
  "newAudioUrl": ""
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─jobId

string

作品ID

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "jobId": ""
  }
}

1.2.查询作品状态

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 查询作品状态

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

jobId

string

作品ID

true

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/works/inspect' --data '{
  "jobId": ""
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─status

int32

作品状态, 1:排队中 2:处理中 3:完成 4:失败

-

└─errorMessage

string

失败原因

-

└─videoUrl

string

合成的视频地址

-

└─duration

int32

视频时长(秒)

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "status": 0,
    "errorMessage": "",
    "videoUrl": "",
    "duration": 0
  }
}

1.3.回调示例

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 回调示例

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

status

int32

作品状态, 1:排队中 2:处理中 3:完成 4:失败

false

-

errorMessage

string

失败原因

false

-

videoUrl

string

合成的视频地址

false

-

duration

int32

视频时长(秒)

false

-

jobId

string

任务 ID

false

-

userId

string

用户 ID

false

-

accessKey

string

accessKey

false

-

modelType

string

No comments found.

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/works/callback' --data '{
  "status": 0,
  "errorMessage": "",
  "videoUrl": "",
  "duration": 0,
  "jobId": "",
  "userId": "",
  "accessKey": "",
  "modelType": ""
}'

Response-example:

string

2.接入准备

2.1.获取token

Type: GET

Author: zhaoliang

Content-Type: application/x-www-form-urlencoded

Description: 获取token

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Query-parameters:

ParameterTypeDescriptionRequiredSince

accessKey

string

AccessKey

true

-

timestamp

string

签名使用的时间戳(3分钟时效),精确到毫秒

true

-

sign

string

生成的签名,通过AccessKey、时间戳(毫秒)、SecretKey三者拼接后md5加密生成。MD5加密后的结果类型:小写。 如:md5(AccessKey+ 时间戳(毫秒)+ SecretKey)

true

-

Request-example:

curl -X GET -H "authorization-token:token请求头的值" -i '/api/model/v5/oauth/token?accessKey=&sign=×tamp='

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─token

string

token值

-

└─expiresIn

int64

token过期时间戳,精确到毫秒

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "token": "",
    "expiresIn": 0
  }
}

3.语音LITE版本相关API

3.1.语音LITE版本-训练

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 语音LITE版本-训练

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

speakerId

string

唯一音色代号,若是首次训练可以给空字符串;若是已有音色代号,可以用相同的音色代号重复训练,同一个音色代号最多重复训练10次

false

-

audioUrl

string

音频URL

false

-

callbackUrl

string

回调地址

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/lite/train' --data '{
  "speakerId": "",
  "audioUrl": "",
  "callbackUrl": ""
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─speakerId

string

唯一音色代号,若是首次训练可以给空字符串;若是已有音色代号,可以用相同的音色代号重复训练,同一个音色代号最多重复训练10次

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "speakerId": ""
  }
}

3.2.语音LITE版本-状态查询

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 语音LITE版本-状态查询

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

speakerId

string

唯一音色代号

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/lite/train/detail' --data '{
  "speakerId": ""
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─status

int32

作品状态, 1:排队中 2:处理中 3:完成 4:失败

-

└─errorMessage

string

失败原因

-

└─speakerId

string

任务 ID

-

└─userId

string

用户 ID

-

└─accessKey

string

accessKey

-

└─type

string

语音类型,标准版 LITE 专业版 PRO

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "status": 0,
    "errorMessage": "",
    "speakerId": "",
    "userId": "",
    "accessKey": "",
    "type": ""
  }
}

3.3.语音LITE版本-回调示例

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 语音LITE版本-回调示例

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

status

int32

作品状态, 1:排队中 2:处理中 3:完成 4:失败

false

-

errorMessage

string

失败原因

false

-

speakerId

string

任务 ID

false

-

userId

string

用户 ID

false

-

accessKey

string

accessKey

false

-

type

string

语音类型,标准版 LITE 专业版 PRO

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/lite/train/callback' --data '{
  "status": 0,
  "errorMessage": "",
  "speakerId": "",
  "userId": "",
  "accessKey": "",
  "type": ""
}'

Response-example:

string

3.4.音频LITE版本-合成

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 音频LITE版本-合成

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

speakerId

string

唯一音色ID

true

-

content

string

内容

true

-

kyyRole

string

跨语言,no-否,yes-是

false

-

speedRatio

string

语速,建议0.5-1.5,不允许小于0.1,不允许大于1.9

false

-

pitchRatio

string

语调,建议0.5-5,不允许小于0.1,不允许大于10

false

-

volumeRatio

string

音量,建议0.5-5,不允许小于0.1,不允许大于10

false

-

callbackUrl

string

回调地址

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/lite/create' --data '{
  "speakerId": "",
  "content": "",
  "kyyRole": "",
  "speedRatio": "",
  "pitchRatio": "",
  "volumeRatio": "",
  "callbackUrl": ""
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─jobId

string

音频合成任务 ID

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "jobId": ""
  }
}

3.5.音频LITE版本-合成状态查询

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 音频LITE版本-合成状态查询

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

jobId

string

语音合成任务 ID

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/lite/create/detail' --data '{
  "jobId": ""
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─status

int32

作品状态, 1:排队中 2:处理中 3:完成 4:失败

-

└─errorMessage

string

失败原因

-

└─jobId

string

任务 ID

-

└─url

string

合成的音频地址

-

└─duration

int32

音频时长(秒)

-

└─userId

string

用户 ID

-

└─accessKey

string

accessKey

-

└─type

string

语音类型,标准版 LITE 专业版 PRO

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "status": 0,
    "errorMessage": "",
    "jobId": "",
    "url": "",
    "duration": 0,
    "userId": "",
    "accessKey": "",
    "type": ""
  }
}

3.6.音频LITE版本-回调示例

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 音频LITE版本-回调示例

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

status

int32

作品状态, 1:排队中 2:处理中 3:完成 4:失败

false

-

errorMessage

string

失败原因

false

-

jobId

string

任务 ID

false

-

url

string

合成的音频地址

false

-

duration

int32

音频时长(秒)

false

-

userId

string

用户 ID

false

-

accessKey

string

accessKey

false

-

type

string

语音类型,标准版 LITE 专业版 PRO

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/lite/create/callback' --data '{
  "status": 0,
  "errorMessage": "",
  "jobId": "",
  "url": "",
  "duration": 0,
  "userId": "",
  "accessKey": "",
  "type": ""
}'

Response-example:

string

4.语音PRO版本相关API

4.1.语音PRO版本-训练

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 语音PRO版本-训练

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

speakerId

string

唯一音色代号,若是首次训练可以给空字符串;若是已有音色代号,可以用相同的音色代号重复训练,同一个音色代号最多重复训练10次

false

-

audioUrl

string

音频URL

false

-

callbackUrl

string

回调地址

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/pro/train' --data '{
  "speakerId": "",
  "audioUrl": "",
  "callbackUrl": ""
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─speakerId

string

唯一音色代号,若是首次训练可以给空字符串;若是已有音色代号,可以用相同的音色代号重复训练,同一个音色代号最多重复训练10次

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "speakerId": ""
  }
}

4.2.语音PRO版本-训练状态查询

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 语音PRO版本-训练状态查询

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

speakerId

string

唯一音色代号

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/pro/train/detail' --data '{
  "speakerId": ""
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─status

int32

作品状态, 1:排队中 2:处理中 3:完成 4:失败

-

└─errorMessage

string

失败原因

-

└─speakerId

string

任务 ID

-

└─userId

string

用户 ID

-

└─accessKey

string

accessKey

-

└─type

string

语音类型,标准版 LITE 专业版 PRO

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "status": 0,
    "errorMessage": "",
    "speakerId": "",
    "userId": "",
    "accessKey": "",
    "type": ""
  }
}

4.3.语音PRO版本-回调示例

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 语音PRO版本-回调示例

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

status

int32

作品状态, 1:排队中 2:处理中 3:完成 4:失败

false

-

errorMessage

string

失败原因

false

-

speakerId

string

任务 ID

false

-

userId

string

用户 ID

false

-

accessKey

string

accessKey

false

-

type

string

语音类型,标准版 LITE 专业版 PRO

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/pro/train/callback' --data '{
  "status": 0,
  "errorMessage": "",
  "speakerId": "",
  "userId": "",
  "accessKey": "",
  "type": ""
}'

Response-example:

string

4.4.音频PRO版本-合成

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 音频PRO版本-合成

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

speakerId

string

唯一音色ID

true

-

content

string

内容

true

-

speedRatio

string

语速,默认 1.0

false

-

pitchRatio

string

语调,默认 1.0

false

-

volumeRatio

string

音量,默认 1.0

false

-

callbackUrl

string

回调地址

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/pro/create' --data '{
  "speakerId": "",
  "content": "",
  "speedRatio": "",
  "pitchRatio": "",
  "volumeRatio": "",
  "callbackUrl": ""
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─jobId

string

音频合成任务 ID

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "jobId": ""
  }
}

4.5.音频PRO版本-状态查询

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 音频PRO版本-状态查询

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

jobId

string

语音合成任务 ID

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/pro/create/detail' --data '{
  "jobId": ""
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─status

int32

作品状态, 1:排队中 2:处理中 3:完成 4:失败

-

└─errorMessage

string

失败原因

-

└─jobId

string

任务 ID

-

└─url

string

合成的音频地址

-

└─duration

int32

音频时长(秒)

-

└─userId

string

用户 ID

-

└─accessKey

string

accessKey

-

└─type

string

语音类型,标准版 LITE 专业版 PRO

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "status": 0,
    "errorMessage": "",
    "jobId": "",
    "url": "",
    "duration": 0,
    "userId": "",
    "accessKey": "",
    "type": ""
  }
}

4.6.音频PRO版本-回调示例

Type: POST

Author: zhaoliang

Content-Type: application/json

Description: 音频PRO版本-回调示例

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Body-parameters:

ParameterTypeDescriptionRequiredSince

status

int32

作品状态, 1:排队中 2:处理中 3:完成 4:失败

false

-

errorMessage

string

失败原因

false

-

jobId

string

任务 ID

false

-

url

string

合成的音频地址

false

-

duration

int32

音频时长(秒)

false

-

userId

string

用户 ID

false

-

accessKey

string

accessKey

false

-

type

string

语音类型,标准版 LITE 专业版 PRO

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -H "authorization-token:token请求头的值" -i '/api/model/v5/voice/pro/create/callback' --data '{
  "status": 0,
  "errorMessage": "",
  "jobId": "",
  "url": "",
  "duration": 0,
  "userId": "",
  "accessKey": "",
  "type": ""
}'

Response-example:

string

5.用户相关API

5.1.查询余额

Type: GET

Author: zhaoliang

Content-Type: application/x-www-form-urlencoded

Description: 查询余额

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Request-example:

curl -X GET -H "authorization-token:token请求头的值" -i '/api/model/v5/user/balance'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─balance

int32

积分余额

-

└─voiceLiteUsedQuantity

int32

音色 LITE 版本已用数

-

└─voiceLiteTotalQuantity

int32

音色 LITE 版本总数

-

└─voiceProUsedQuantity

int32

音色 PRO 版本已用数

-

└─voiceProTotalQuantity

int32

音色 PRO 版本总数

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "balance": 0,
    "voiceLiteUsedQuantity": 0,
    "voiceLiteTotalQuantity": 0,
    "voiceProUsedQuantity": 0,
    "voiceProTotalQuantity": 0
  }
}

5.2.查询视频合成积分消费明细

Type: GET

Author: zhaoliang

Content-Type: application/x-www-form-urlencoded

Description: 查询视频合成积分消费明细

Request-headers:

HeaderTypeDescriptionRequiredSince

authorization-token

string

接口获取到的token,获取token接口忽略

true

-

Query-parameters:

ParameterTypeDescriptionRequiredSince

pn

int32

页码

true

-

ds

int32

每页条数

true

-

Request-example:

curl -X GET -H "authorization-token:token请求头的值" -i '/api/model/v5/user/bill/list?pn=0&ds=0'

Response-fields:

FieldTypeDescriptionSince

code

int32

错误码

-

msg

string

错误描述

-

data

object

返回数据

-

└─total

int64

总数

-

└─list

array

积分消耗信息列表

-

     └─type

string

消耗类型

-

     └─time

string

消费时间

-

     └─duration

int32

音频时长(秒)

-

     └─fee

int32

本次扣除积分

-

Response-example:

{
  "code": 0,
  "msg": "",
  "data": {
    "total": 0,
    "list": [
      {
        "type": "",
        "time": "",
        "duration": 0,
        "fee": 0
      }
    ]
  }
}

6.错误码列表

Error codeDescription

0

成功

20001

未开通帐号

20002

无效token

20003

签名错误

20004

参数不正确

20005

积分不足

20006

找不到资源

20007

正在生成中的作品数量达到上限

20008

提交的作品数量达到上限

20009

文件大小超过限制

20010

文件类型不支持

20011

获取音频资源失败

20012

获取视频资源失败

20013

不合法的音频地址

20014

不合法的音频时长

20015

不合法的文件大小

20016

缺少必要文件

20017

文件上传失败

20018

文件下载失败

20019

不支持的背景图片格式

20020

提交训练视频失败

20021

不合法的码率值

20022

不合法的分辨率值

20023

不合法的fps值

20024

模特不存在

20025

模特已过期

20026

不合法的视频格式

20027

API权限不足

20901

其他错误

20902

内部异常

10001

系统异常

10002

请求超过限制

10003

操作频繁

10004

执行失败

30001

音色训练提交失败

30002

音色数量不足

Top