同步语音合成 V2
⚠️ 测试中
▼
Authorization
在 Header 添加参数 Authorization,其值为 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
请求参数
Header 参数
Content-Type
string
可选
示例: application/json
Authorization
string
可选
示例: Bearer {{YOUR_API_KEY}}
Body 参数 application/json
model
string
必需
模型名称
text
string
必需
要转换的文本内容
voice_setting
object
可选
音色设置
示例
{
"model": "speech-02-hd",
"text": "你好,欢迎使用语音合成服务!",
"voice_setting": {
"voice_id": "moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85"
}
}
请求示例代码
curl --location --request POST 'https://api.quickrouter.ai/minimax/v1/t2a_v2' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{
"model": "speech-02-hd",
"text": "你好,欢迎使用语音合成服务!",
"voice_setting": {
"voice_id": "moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85"
}
}'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_API_KEY");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"model": "speech-02-hd",
"text": "你好,欢迎使用语音合成服务!",
"voice_setting": {
"voice_id": "moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85"
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.quickrouter.ai/minimax/v1/t2a_v2", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
import http.client
import json
conn = http.client.HTTPSConnection("api.quickrouter.ai")
payload = json.dumps({
"model": "speech-02-hd",
"text": "你好,欢迎使用语音合成服务!",
"voice_setting": {
"voice_id": "moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85"
}
})
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
conn.request("POST", "/minimax/v1/t2a_v2", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
返回响应
响应参数 application/json
data
object
可选
音频数据
extra_info
object
可选
额外信息
trace_id
string
可选
追踪ID
base_resp
object
可选
基本响应
示例
{
"data": {
"audio": "2f2f2f2f504b0304...",
"status": 2
},
"extra_info": {
"audio_length": 9900,
"audio_sample_rate": 32000,
"audio_size": 160323,
"bitrate": 128000,
"word_count": 52,
"invisible_character_ratio": 0,
"usage_characters": 26,
"audio_format": "mp3",
"audio_channel": 1
},
"trace_id": "01b8bf9bb7433cc75c18eee6cfa8fe21",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}