https://api.numspirit.com/sk-silievo-xxxxxxxx| 模型 | 说明 |
|---|---|
cosyvoice-v3-flash | 阿里云 CosyVoice 语音合成模型,支持多种音色 |
Content-Type: application/json
Authorization: Bearer sk-silievo-xxxxxxxx| 属性 | 说明 |
|---|---|
| 接口地址 | POST https://api.numspirit.com/v1/audio/tts |
| 模型 | cosyvoice-v3-flash |
| 计费模式 | 按字符数计费 |
{
"model": "cosyvoice-v3-flash",
"input": {
"text": "今天天气太棒了,我该去哪里玩呢?",
"voice": "longanhuan",
"format": "mp3"
}
}| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型名称,固定为 cosyvoice-v3-flash |
input.text | string | 是 | 要合成的文本内容 |
input.voice | string | 是 | 音色名称,如 longanhuan、longanyang 等 |
input.format | string | 是 | 音频格式,可选值:mp3、wav、pcm |
提示: voice参数支持系统内置音色(如longanhuan)和自定义音色 (通过音色创建接口生成,格式为cosyvoice-v3.5-plus-{prefix}-{随机字符串})。
{
"output": {
"audio": {
"data": "",
"expires_at": 1783639261,
"id": "audio_b9b56240-41b9-9077-a2cc-cc334309d00e",
"url": "http://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/prod/cosyvoice-v3-flash/20260709/1498978315340840/b9b56240-41b9-9077-a2cc-cc334309d00e.mp3?Expires=1783639261&OSSAccessKeyId=LTAI5tGzqbGcEmE58b221XQy&Signature=aaWNCDAHgYywxldosBwh6DIwoPo%3D"
},
"finish_reason": "stop"
},
"usage": {
"characters": 30
},
"request_id": "b9b56240-41b9-9077-a2cc-cc334309d00e"
}| 字段 | 类型 | 说明 |
|---|---|---|
output.audio.url | string | 合成后的音频文件 URL |
output.audio.id | string | 音频文件唯一标识 |
output.audio.expires_at | integer | URL 过期时间戳(Unix 时间戳) |
output.finish_reason | string | 完成原因,stop 表示正常完成 |
usage.characters | integer | 消耗的字符数 |
request_id | string | 请求唯一标识 |
| 音色名称 | 说明 |
|---|---|
longanyang | 通用男声 |
longanhuan | 通用女声 |
提示:更多音色请联系客服获取。
详情请参考:https://bailian.console.aliyun.com/cn-beijing/?tab=doc#/doc/?type=model&url=2879134
| 错误类型 | HTTP 状态码 | 说明 | 解决方案 |
|---|---|---|---|
auth_error | 401 | 认证失败,API Key 无效或未提供 | 检查 Authorization Header 格式 |
quota_exceeded | 402 | 额度已用尽 | 充值或联系客服 |
invalid_request | 400 | 请求参数错误 | 检查请求体 JSON 格式和必填字段 |
no_channel | 503 | 模型未配置有效渠道 | 检查 model 参数是否正确 |
upstream_error | 502/500 | 上游 API 错误 | 稍后重试或联系客服 |