跳转到主要内容
CosyVoice

创建克隆音色(CosyVoice)

通过上传音频创建 CosyVoice 克隆音色。

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",
    "prefix": "myvoice",
    "url": "https://your-audio-url.wav",
    "language_hints": ["zh"]
  }
}'
{
  "output": {
    "voice_id": "cosyvoice-v3.5-plus-myvoice-xxxxxx"
  },
  "usage": {
    "count": 1
  },
  "request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
音色创建后需要审核。通过查询音色详情确认状态为 OK 后方可使用。状态说明参见概述

鉴权

string
header
必填

DashScope API Key。前往获取 API Key

请求体

application/json
enum<string>
必填

固定为 voice-enrollment

voice-enrollment
voice-enrollment
object
必填

响应

200-application/json
object
object
string

请求 ID,用于问题排查。

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx