音色接口
选择内置音色、读取详情,或使用录音创建自己的音色。
当前环境请求基址
https://api.jiuma.com获取音色列表
分页查询当前用户可见的音色。
POST
/voice/describeVoicesList请求地址:https://api.jiuma.com/voice/describeVoicesList
请求参数
| 参数 | 类型 | 要求 | 说明 |
|---|---|---|---|
page | int | 选填 | 页码,默认 1 |
list_rows | int | 选填 | 每页条数,默认 15 |
search_key | string | 选填 | 按名称、主播名称或数字 ID 搜索 |
belong_type | int | 选填 | 1 内置、2 自定义 |
请求示例
cURL · Bash / macOS / Linux
curl -X POST "https://api.jiuma.com/voice/describeVoicesList" \
-H "X-Secret-Key: <secret_id-secret_key>" \
-d "page=1&search_key=客服"响应示例
JSON
{
"code": 200,
"message": "获取成功",
"data": {
"total": 1,
"per_page": 15,
"current_page": 1,
"data": [
{
"id": 789,
"name": "客服女声",
"belong_type": 2,
"gender": 2
}
]
}
}常见失败原因
查询失败;没有匹配音色时返回空列表。
获取音色详情
读取内置音色或当前认证用户自己的音色,返回公开字段。
POST
/voice/getVoiceInfo请求地址:https://api.jiuma.com/voice/getVoiceInfo
请求参数
| 参数 | 类型 | 要求 | 说明 |
|---|---|---|---|
voice_id | int | 必填 | 正整数音色 ID |
请求示例
cURL · Bash / macOS / Linux
curl -X POST "https://api.jiuma.com/voice/getVoiceInfo" \
-H "X-Secret-Key: <secret_id-secret_key>" \
-d "voice_id=789"响应示例
JSON
{
"code": 200,
"message": "获取成功",
"data": {
"id": 789,
"name": "客服女声",
"age": 0,
"belong_type": 2,
"type": 1,
"gender": 2,
"volume": 1,
"des_label": ""
}
}常见失败原因
未认证、音色 ID 无效或不存在、音色已停用、无权查看其他用户音色。
创建音色
使用音频 URL 或 Base64 克隆 IndexTTS 音色。
POST
/voice/createVoice请求地址:https://api.jiuma.com/voice/createVoice
请求参数
| 参数 | 类型 | 要求 | 说明 |
|---|---|---|---|
file_url | string | 必填 | 公网 HTTP(S) 音频地址或 audio/*;base64 Data URI,最大 20 MB |
name | string | 选填 | 音色名称 |
text | string | 选填 | 录音对应文本 |
lang | string | 选填 | chinese 或 english,默认 chinese |
speed | float | 选填 | 建议 0.7 至 1.3,默认 1 |
volume | float | 选填 | 0 至 1,默认 1 |
请求示例
cURL · Bash / macOS / Linux
curl -X POST "https://api.jiuma.com/voice/createVoice" \
-H "X-Secret-Key: <secret_id-secret_key>" \
--data-urlencode "file_url=https://example.com/voice.wav" \
-d "name=客服女声" \
-d "lang=chinese" \
-d "speed=1" \
-d "volume=1"响应示例
JSON
{
"code": 200,
"message": "操作成功",
"data": 789
}关键返回字段
data- 创建成功后返回音色 ID,文本驱动视频可将其作为 audio_config。
常见失败原因
缺少音频、地址不可访问、文件超过 20 MB、音频内容或时长不符合克隆要求、创建失败。