C端复刻接口
更新时间:2026-01-28
创建复刻音色接口
接口描述
C端用通过appServer调用创建C端用户复刻音色
请求语法
JSON
1POST /api/v{version}/ttsVoice/client_clone/create HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 名称 | 类型 | 是否必选 | 参数位置 | 描述 |
|---|---|---|---|---|
| app_id | String | 是 | RequestBody | 大模型互动应用ID |
| uniq_id | String | 是 | RequestBody | C端用户唯一标识,用于管理C端用户复刻的音色 |
| name | String | 否 | RequestBody | 音色名称 |
| description | String | 否 | RequestBody | 音色描述 |
| audition_text | String | 否 | RequestBody | 试听文本内容 |
| audios | List | 是 | RequestBody | 限制单文件上传最大10MB |
| +audio_bytes | String | 是 | RequestBody | 二进制音频字节,需对二进制音频进行base64编码 |
| +audio_format | String | 是 | RequestBody | wav、mp3 |
| +text | String | 是 | RequestBody | 音频文件内容 |
| language | Integer | 否 | RequestBody | cn = 0 中文(默认),en = 1 英文,ja = 2 日语 |
请求示例
JSON
1POST /api/v1/ttsVoice/client_clone/create HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
6{
7 "app_id": "appxxx",
8 "uniq_id": "123456",
9 "name": "voiceName",
10 "description": "this is a client clone voice",
11 "audition_text": "随便说一说",
12 "audios": [
13 {
14 "audio_bytes": "real base64 data1",
15 "audio_format": "mp3",
16 "text": "你好啊"
17 },
18 {
19 "audio_bytes": "real base64 data2",
20 "audio_format": "wav",
21 "text": "你在干什么"
22 }
23 ],
24 "language": 0
25}
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| voice_id | String | 发音人ID |
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
7{
8 "voice_id": "cloneVoiceId1"
9}
重新训练复刻音色接口
接口描述
C端用通过appServer调用重新训练复刻音色,该接口限制同一音色最大重新训练三次(不包含创建那一次)
请求语法
JSON
1PUT /api/v{version}/ttsVoice/client_clone/update/{voice_id} HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 名称 | 类型 | 是否必选 | 参数位置 | 描述 |
|---|---|---|---|---|
| voice_id | String | 是 | PathVariable | 复刻的音色ID |
| app_id | String | 是 | RequestBody | 大模型互动应用ID |
| uniq_id | String | 是 | RequestBody | C端用户唯一标识,用于管理C端用户复刻的音色 |
| name | String | 否 | RequestBody | 音色名称 |
| description | String | 否 | RequestBody | 音色描述 |
| audition_text | String | 否 | RequestBody | 试听文本内容 |
| audios | List | 是 | RequestBody | 限制单文件上传最大10MB |
| +audio_bytes | String | 是 | RequestBody | 二进制音频字节,需对二进制音频进行base64编码 |
| +audio_format | String | 是 | RequestBody | wav、mp3 |
| +text | String | 是 | RequestBody | 音频文件内容 |
| language | Integer | 否 | RequestBody | cn = 0 中文(默认),en = 1 英文,ja = 2 日语 |
请求示例
JSON
1PUT /api/v1/ttsVoice/client_clone/update/testVoiceId HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
6{
7 "app_id": "appxxx",
8 "uniq_id": "123456",
9 "name": "voiceName",
10 "description": "this is a client clone voice",
11 "audition_text": "随便说一说",
12 "audios": [
13 {
14 "audio_bytes": "real base64 data1",
15 "audio_format": "mp3",
16 "text": "你好啊"
17 },
18 {
19 "audio_bytes": "real base64 data2",
20 "audio_format": "wav",
21 "text": "你在干什么"
22 }
23 ],
24 "language": 0
25}
响应参数
N/A
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
获取应用/C端用户下音色列表
接口描述
C端用通过appServer调用获取复刻音色列表
请求语法
JSON
1GET /api/v{version}/ttsVoice/client_clone/list HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 名称 | 类型 | 是否必选 | 参数位置 | 描述 |
|---|---|---|---|---|
| app_id | String | 是 | RequestBody | 大模型互动应用ID |
| uniq_id | String | 否 | RequestBody | C端用户唯一标识,用于管理C端用户复刻的音色 |
请求示例
JSON
1GET /api/v1/ttsVoice/client_clone/list HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
6{
7 "app_id": "appxxx",
8 "uniq_id": "123456"
9}
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| total_count | Integer | 总数量 |
| data | list | 数据列表 |
| +uniq_id | String | 用户唯一标识 |
| +voice_id | Long | 音色ID |
| +name | String | 音色名称 |
| +create_time | String | 创建时间 |
| +update_time | String | 修改时间 |
| +audition_url | String | 试听临时文件地址 |
| +status | String | 复刻状态 |
| +language | String | 语言 |
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
7{
8 "data": [
9 {
10 "name": "test",
11 "status": "TRAINED",
12 "language": "cn",
13 "uniq_id": "333333",
14 "voice_id": 100000000,
15 "create_time": "2025-09-20T11:02:05.000+00:00",
16 "update_time": "2025-09-30T03:05:08.000+00:00",
17 "audition_url": "http://xxx"
18 }
19 ],
20 "total_count": 1
21}
删除C端用户下音色
接口描述
C端用通过appServer调用删除复刻音色
请求语法
JSON
1DELETE /api/v{version}/ttsVoice/client_clone/{appId}/{uniqId}/{voiceId} HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 名称 | 类型 | 是否必选 | 参数位置 | 描述 |
|---|---|---|---|---|
| app_id | String | 是 | PathVariable | 大模型互动应用ID |
| uniq_id | String | 是 | PathVariable | C端用户唯一标识,用于管理C端用户复刻的音色 |
| voice_id | String | 是 | PathVariable | 复刻的音色ID |
请求示例
JSON
1DELETE /api/v1/ttsVoice/client_clone/appxxx/123456/testVoiceId HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
响应参数
N/A
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
