https://platform.minimaxi.com/docs/api-reference/speech-t2a-http
POST
/minimax/v1/t2a_v2同步语音合成 V2
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/minimax/v1/t2a_v2 \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "speech-02-hd",
"text": "你好,欢迎使用语音合成服务!",
"voice_setting": {
"voice_id": "moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85"
}
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Content-Type | Header | string | 是 | 请求体的媒介类型,必须设置为 application/json 以确保请求数据的格式为 JSON | - |
返回响应 (200)
成功响应,返回合成的音频数据(hex 编码或 URL)以及相关统计信息
此部分没有定义参数。
返回响应 (400)
请求参数错误
此部分没有定义参数。
返回响应 (401)
鉴权失败
此部分没有定义参数。
返回响应 (429)
触发限流
此部分没有定义参数。
响应示例
{
"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"
}
}来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 495899865,
"name": "同步语音合成 V2",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "https://platform.minimaxi.com/docs/api-reference/speech-t2a-http",
"operationId": "textToAudioV2",
"sourceUrl": "",
"method": "post",
"path": "/minimax/v1/t2a_v2",
"tags": [
"语音合成"
],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {},
"x-apifox-orders": []
},
"examples": [
{
"name": "最简单的语音合成示例",
"value": "{\n \"model\": \"speech-02-hd\",\n \"text\": \"你好,欢迎使用语音合成服务!\",\n \"voice_setting\": {\n \"voice_id\": \"moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85\"\n }\n}",
"oasKey": "基础非流式合成",
"oasExtensions": "",
"mediaType": "application/json"
},
{
"name": "使用语气词标签增强表现力",
"value": "{\n \"model\": \"speech-2.8-hd\",\n \"text\": \"今天是不是很开心呀(laughs),当然了(breath)!\",\n \"stream\": false,\n \"voice_setting\": {\n \"voice_id\": \"male-qn-qingse\",\n \"speed\": 1,\n \"vol\": 1,\n \"pitch\": 0,\n \"emotion\": \"happy\"\n },\n \"pronunciation_dict\": {\n \"tone\": [\n \"处理/(chu3)(li3)\",\n \"危险/dangerous\"\n ]\n },\n \"audio_setting\": {\n \"sample_rate\": 32000,\n \"bitrate\": 128000,\n \"format\": \"mp3\",\n \"channel\": 1\n },\n \"subtitle_enable\": false\n}",
"oasKey": "带语气词的合成",
"oasExtensions": "",
"mediaType": "application/json"
},
{
"name": "流式输出可以更快地获得音频反馈",
"value": "{\n \"model\": \"speech-2.8-turbo\",\n \"text\": \"这是一段较长的文本,使用流式输出可以边合成边播放,减少等待时间。\",\n \"stream\": true,\n \"stream_options\": {\n \"exclude_aggregated_audio\": false\n },\n \"voice_setting\": {\n \"voice_id\": \"English_Graceful_Lady\",\n \"speed\": 1.2\n },\n \"audio_setting\": {\n \"format\": \"mp3\",\n \"force_cbr\": true\n }\n}",
"oasKey": "流式输出",
"oasExtensions": "",
"mediaType": "application/json"
},
{
"name": "使用多种音色混合创造独特声音",
"value": "{\n \"model\": \"speech-2.6-hd\",\n \"text\": \"这是使用混合音色的语音合成示例。\",\n \"voice_setting\": {\n \"voice_id\": \"\",\n \"speed\": 1,\n \"vol\": 1\n },\n \"timber_weights\": [\n {\n \"voice_id\": \"female-chengshu\",\n \"weight\": 30\n },\n {\n \"voice_id\": \"female-tianmei\",\n \"weight\": 70\n }\n ]\n}",
"oasKey": "混合音色",
"oasExtensions": "",
"mediaType": "application/json"
},
{
"name": "使用声音效果器调整音色特征",
"value": "{\n \"model\": \"speech-2.6-hd\",\n \"text\": \"这是带声音效果器的语音合成。\",\n \"voice_setting\": {\n \"voice_id\": \"English_Persuasive_Man\"\n },\n \"voice_modify\": {\n \"pitch\": 20,\n \"intensity\": -30,\n \"timbre\": 10,\n \"sound_effects\": \"robotic\"\n }\n}",
"oasKey": "声音效果器",
"oasExtensions": "",
"mediaType": "application/json"
}
],
"mediaType": "application/json",
"oasExtensions": "",
"required": true,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": [
{
"id": "5UQxpCXpXb",
"name": "Content-Type",
"required": true,
"enable": true,
"description": "请求体的媒介类型,必须设置为 application/json 以确保请求数据的格式为 JSON",
"type": "string",
"schema": {
"type": "string",
"enum": [
"application/json"
],
"default": "application/json"
},
"sampleValue": ""
}
]
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {
"type": "inherit",
"inherit": {}
},
"responses": [
{
"id": 129066479,
"name": "成功",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {},
"x-apifox-orders": []
},
"itemSchema": {},
"description": "成功响应,返回合成的音频数据(hex 编码或 URL)以及相关统计信息",
"mediaType": "application/json",
"headers": [],
"oasExtensions": ""
},
{
"id": 135905278,
"name": "请求有误",
"code": 400,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {},
"x-apifox-orders": []
},
"itemSchema": {},
"description": "请求参数错误",
"mediaType": "application/json",
"headers": [],
"oasExtensions": ""
},
{
"id": 157330924,
"name": "没有权限",
"code": 401,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {},
"x-apifox-orders": []
},
"itemSchema": {},
"description": "鉴权失败",
"mediaType": "application/json",
"headers": [],
"oasExtensions": ""
},
{
"id": 176318347,
"name": "禁止访问",
"code": 429,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {},
"x-apifox-orders": []
},
"itemSchema": {},
"description": "触发限流",
"mediaType": "application/json",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [
{
"name": "非流式合成完成后的完整响应",
"responseId": 129066479,
"data": "{\n \"data\": {\n \"audio\": \"2f2f2f2f504b0304...\",\n \"status\": 2\n },\n \"extra_info\": {\n \"audio_length\": 9900,\n \"audio_sample_rate\": 32000,\n \"audio_size\": 160323,\n \"bitrate\": 128000,\n \"word_count\": 52,\n \"invisible_character_ratio\": 0,\n \"usage_characters\": 26,\n \"audio_format\": \"mp3\",\n \"audio_channel\": 1\n },\n \"trace_id\": \"01b8bf9bb7433cc75c18eee6cfa8fe21\",\n \"base_resp\": {\n \"status_code\": 0,\n \"status_msg\": \"success\"\n }\n}",
"description": "",
"oasKey": "非流式成功响应",
"oasExtensions": "",
"id": "019fc09b-0b2e-723f-adf0-f29122aab2d0"
},
{
"name": "启用字幕功能后的响应",
"responseId": 129066479,
"data": "{\n \"data\": {\n \"audio\": \"2f2f2f2f504b0304...\",\n \"subtitle_file\": \"https://filecdn.minimax.chat/subtitle/subtitle_123.json\",\n \"status\": 2\n },\n \"extra_info\": {\n \"audio_length\": 12000,\n \"audio_sample_rate\": 32000,\n \"audio_size\": 195000,\n \"word_count\": 68,\n \"usage_characters\": 68\n },\n \"trace_id\": \"subtitle_example_123\",\n \"base_resp\": {\n \"status_code\": 0,\n \"status_msg\": \"success\"\n }\n}",
"description": "",
"oasKey": "带字幕的响应",
"oasExtensions": "",
"id": "019fc09b-0b2e-723f-adf0-f73a11116832"
},
{
"name": "参数错误",
"responseId": 135905278,
"data": "{\n \"base_resp\": {\n \"status_code\": 2013,\n \"status_msg\": \"输入参数信息不正常:voice_id 不能为空\"\n }\n}",
"description": "",
"oasKey": "参数错误",
"oasExtensions": "",
"id": "019fc09b-0b2e-723f-adf0-fade608c80a5"
},
{
"name": "鉴权失败",
"responseId": 157330924,
"data": "{\n \"base_resp\": {\n \"status_code\": 1004,\n \"status_msg\": \"鉴权失败,请检查 API-Key 是否正确\"\n }\n}",
"description": "",
"oasKey": "鉴权失败",
"oasExtensions": "",
"id": "019fc09b-0b2e-723f-adf0-fcc9d049d840"
},
{
"name": "触发限流",
"responseId": 176318347,
"data": "{\n \"base_resp\": {\n \"status_code\": 1002,\n \"status_msg\": \"触发限流,请稍后再试\"\n }\n}",
"description": "",
"oasKey": "触发限流",
"oasExtensions": "",
"id": "019fc09b-0b2e-723f-adf1-01433c3f8201"
}
],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92436087,
"ordering": 6,
"responsibleId": 0,
"commonResponseStatus": {},
"advancedSettings": {
"disabledSystemHeaders": {}
},
"customApiFields": {},
"oasExtensions": "",
"mockScript": {},
"createdAt": "2026-08-02T03:53:34.000Z",
"updatedAt": "2026-08-06T12:15:55.000Z",
"creatorId": 2863449,
"editorId": 2863449,
"creatorUserId": 2863449,
"editorUserId": 2863449,
"responseChildren": [],
"visibility": "INHERITED",
"securityScheme": {},
"callbacks": ""
}