POST
/services/audio/tts/customization
cURL
复制
curl -X POST https://dashscope.aliyuncs.com/api/v1/services/audio/tts/customization \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "voice-enrollment",
"input": {
"action": "create_voice",
"target_model": "cosyvoice-v3.5-plus",
"voice_prompt": "沉稳的中年男性,音色低沉浑厚",
"preview_text": "各位听众朋友,大家好",
"prefix": "announcer",
"language_hints": ["zh"]
},
"parameters": {
"sample_rate": 24000,
"response_format": "wav"
}
}'复制
{
"output": {
"voice_id": "cosyvoice-v3.5-plus-mydesign-xxxxxx",
"preview_audio": {
"data": "<string>",
"sample_rate": 24000,
"response_format": "mp3"
}
},
"usage": {
"count": 1
},
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}鉴权
string
header
必填
DashScope API Key。前往获取 API Key。
请求体
application/jsonenum<string>
必填
固定为 voice-enrollment。
可选值:voice-enrollment
示例:voice-enrollment
object
必填
显示子属性
显示子属性
enum<string>
必填
固定为 create_voice。
可选值:create_voice
示例:create_voice
enum<string>
必填
设计音色绑定的语音合成模型。必须与后续调用语音合成接口时使用的模型一致,否则合成会失败。
可选值:cosyvoice-v3.5-plus,cosyvoice-v3.5-flash,cosyvoice-v3-plus,cosyvoice-v3-flash
示例:cosyvoice-v3.5-plus
string
必填
音色名称前缀,仅限字母和数字,最长 10 个字符。
示例:mydesign
取值范围:length <= 10
string
必填
声音描述文本。最大长度 500 个字符。
示例:语速适中,音调偏高,充满活力
取值范围:length <= 500
string
必填
预览文本,用于试听设计效果。最小长度 15 个字符,最大长度 200 个字符。
示例:你好,欢迎使用声音设计功能。
取值范围:length: 15–200
string[]
默认值["zh"]
语言提示。仅支持 zh、en。
示例:
复制
[
"zh"
]