创建异步语音合成任务 V2
POST /minimax/v1/t2a_async_v2
说明
概览
| Method | POST |
|---|---|
| Path | /minimax/v1/t2a_async_v2 |
| Type | http |
| Status | 1 |
| Module | 2102810 |
| Folder | 78007621 |
参数
{ "query": [], "path": [], "cookie": [], "header": [ { "id": "vnBVfqnKyb", "name": "Content-Type", "required": true, "enable": true, "description": "请求体的媒介类型,必须设置为 application/json 以确保请求数据的格式为 JSON", "type": "string", "schema": { "type": "string", "enum": [ "application/json" ], "default": "application/json" }, "sampleValue": "" } ] }
请求体
{ "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", "properties": {} }, "required": true, "mediaType": "application/json", "examples": [ { "name": "直接提供文本内容", "value": "{\n \"model\": \"speech-02-hd\",\n \"text\": \"真正的危险不是计算机开始像人一样思考,而是人开始像计算机一样思考。\",\n \"voice_setting\": {\n \"voice_id\": \"moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85\",\n \"speed\": 1,\n \"vol\": 1,\n \"pitch\": 0\n }\n}", "oasKey": "文本输入(基础)", "oasExtensions": "", "mediaType": "application/json" }, { "name": "使用所有可选参数的文本输入", "value": "{\n \"model\": \"speech-2.8-hd\",\n \"text\": \"真正的危险不是计算机开始像人一样思考(sighs),而是人开始像计算机一样思考。计算机只是可以帮我们处理一些简单事务。\",\n \"language_boost\": \"auto\",\n \"voice_setting\": {\n \"voice_id\": \"audiobook_male_1\",\n \"speed\": 1,\n \"vol\": 1,\n \"pitch\": 1,\n \"emotion\": \"calm\"\n },\n \"pronunciation_dict\": {\n \"tone\": [\n \"危险/dangerous\"\n ]\n },\n \"audio_setting\": {\n \"audio_sample_rate\": 32000,\n \"bitrate\": 128000,\n \"format\": \"mp3\",\n \"channel\": 2\n },\n \"voice_modify\": {\n \"pitch\": 0,\n \"intensity\": 0,\n \"timbre\": 0,\n \"sound_effects\": \"spacious_echo\"\n },\n \"aigc_watermark\": false\n}", "oasKey": "文本输入(完整参数)", "oasExtensions": "", "mediaType": "application/json" }, { "name": "使用 TXT 文件 ID 作为输入", "value": "{\n \"model\": \"speech-2.8-hd\",\n \"text_file_id\": 123456789,\n \"language_boost\": \"Chinese\",\n \"voice_setting\": {\n \"voice_id\": \"audiobook_male_1\",\n \"speed\": 1.2,\n \"vol\": 1.5,\n \"pitch\": 0\n },\n \"pronunciation_dict\": {\n \"tone\": [\n \"草地/(cao3)(di1)\"\n ]\n },\n \"audio_setting\": {\n \"audio_sample_rate\": 44100,\n \"bitrate\": 256000,\n \"format\": \"flac\",\n \"channel\": 2\n }\n}", "oasKey": "文件输入(TXT)", "oasExtensions": "", "mediaType": "application/json" }, { "name": "使用 ZIP 压缩包批量处理", "value": "{\n \"model\": \"speech-2.8-turbo\",\n \"text_file_id\": 987654321,\n \"voice_setting\": {\n \"voice_id\": \"English_Graceful_Lady\",\n \"speed\": 1,\n \"vol\": 1\n },\n \"audio_setting\": {\n \"format\": \"mp3\",\n \"bitrate\": 128000\n }\n}", "oasKey": "文件输入(ZIP批量)", "oasExtensions": "", "mediaType": "application/json" }, { "name": "处理长文本(接近 5 万字符限制)", "value": "{\n \"model\": \"speech-2.8-hd\",\n \"text\": \"这是一段很长的文本内容...\",\n \"voice_setting\": {\n \"voice_id\": \"Chinese (Mandarin)_Lyrical_Voice\",\n \"speed\": 1\n }\n}", "oasKey": "长文本输入", "oasExtensions": "", "mediaType": "application/json" } ], "oasExtensions": "" }
响应
[ { "id": 146187342, "name": "", "code": 200, "contentType": "json", "jsonSchema": { "type": "object", "properties": {} }, "itemSchema": {}, "description": "任务创建成功,返回任务 ID 和相关信息", "mediaType": "application/json", "headers": [], "oasExtensions": "" }, { "id": 108290161, "name": "", "code": 400, "contentType": "json", "jsonSchema": { "type": "object", "properties": {} }, "itemSchema": {}, "description": "请求参数错误", "mediaType": "application/json", "headers": [], "oasExtensions": "" }, { "id": 149941052, "name": "", "code": 401, "contentType": "json", "jsonSchema": { "type": "object", "properties": {} }, "itemSchema": {}, "description": "鉴权失败", "mediaType": "application/json", "headers": [], "oasExtensions": "" }, { "id": 173481748, "name": "", "code": 429, "contentType": "json", "jsonSchema": { "type": "object", "properties": {} }, "itemSchema": {}, "description": "触发限流", "mediaType": "application/json", "headers": [], "oasExtensions": "" } ]
响应示例
[ { "name": "任务成功创建的标准响应", "responseId": 146187342, "data": "{\n \"task_id\": \"95157322514444\",\n \"task_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"file_id\": 95157322514444,\n \"usage_characters\": 101,\n \"base_resp\": {\n \"status_code\": 0,\n \"status_msg\": \"success\"\n }\n}", "description": "", "oasKey": "任务创建成功", "oasExtensions": "", "id": "019c2809-2039-719d-94af-34513fd6e7ab" }, { "name": "参数错误", "responseId": 108290161, "data": "{\n \"base_resp\": {\n \"status_code\": 2013,\n \"status_msg\": \"参数错误:text 和 text_file_id 必须提供其中之一\"\n }\n}", "description": "", "oasKey": "参数错误", "oasExtensions": "", "id": "019c2809-2039-719d-94af-3a6dc18a27f9" }, { "name": "鉴权失败", "responseId": 149941052, "data": "{\n \"base_resp\": {\n \"status_code\": 1004,\n \"status_msg\": \"鉴权失败,请检查 API-Key 是否正确\"\n }\n}", "description": "", "oasKey": "鉴权失败", "oasExtensions": "", "id": "019c2809-2039-719d-94af-3ce1ba997b3c" }, { "name": "触发限流", "responseId": 173481748, "data": "{\n \"base_resp\": {\n \"status_code\": 1002,\n \"status_msg\": \"触发限流,请稍后再试\"\n }\n}", "description": "", "oasKey": "触发限流", "oasExtensions": "", "id": "019c2809-2039-719d-94af-4095458f3169" } ]