本文档由 云音工坊 自动生成,如有疑问,请联系客服微信:yuntts !
POST https://www.yuntts.com/api/v1/indextts25/clone403 permission_denied403 model_limit_exceeded| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
name | String | 是 | 音色名称,最多 64 字 |
describe | String | 否 | 音色描述,最多 500 字 |
duration_ms | Integer | 否 | 音频时长(毫秒,500 ~ 15000);不传时 WAV / MP3 会自动解析 |
voice_file | File | 二选一 | 上传参考音频文件(multipart/form-data) |
voice_url | String | 二选一 | 公网参考音频直链(application/json 方式),仅支持 公网地址 |
{
"name": "我的音色",
"describe": "参考音频克隆",
"voice_url": "https://www.yuntts.com/tools/tts/reference.wav",
"duration_ms": 6000
}multipart/form-data)| 字段 | 值 |
|---|---|
| name | 我的音色 |
| describe | 参考音频克隆 |
| duration_ms | 6000 |
| voice_file | (选择文件) |
| 参数 | 类型 | 说明 |
|---|---|---|
data.voice_id | String | 新音色 ID,可直接用于创建任务 |
data.name | String | 音色名称 |
data.source | String | 固定为 custom |
data.audio_url | String | 试听地址(本站存储) |
data.avatar_url | String | 头像地址 |
data.asset_id | String | 参考音频素材 ID |
data.saved_to | String | 数据落库标记 |
{
"code": 200,
"message": "音色创建成功",
"data": {
"voice_id": "01a0a970-3c11-7d22-8b55-6c8f1e3a9d22",
"name": "我的音色",
"source": "custom",
"audio_url": "https://www.yuntts.com/wp-content/uploads/my-document/audio/original/1790984400_12345678.wav",
"avatar_url": "https://www.yuntts.com/wp-content/uploads/avatar-tss/ai.webp",
"asset_id": "asset_01a0a96f",
"saved_to": "local_database"
}
}创建成功后音色立即可用:创建任务时传 voice_source=custom+ 该voice_id即可。
| HTTP | error | 说明 |
|---|---|---|
| 400 | missing_name / invalid_name | 没填名称 / 名称超过 64 字 |
| 400 | missing_file | 既没上传 voice_file,也没给 voice_url |
| 400 | invalid_audio_url | 音频地址不是公网 http/https 直链、下载失败或格式不符 |
| 400 | upload_failed | 音频格式、大小或时长不符合要求 |
| 403 | permission_denied | 不是会员 |
| 403 | model_limit_exceeded | 音色数量已达上限 |
| 500 | database_error | 音色写入失败,请稍后重试 |
| 502 | service_error | 创建音色失败,可稍后重试 |