跳转到主要内容
POST
/
v3
/
async
/
minimax-speech-2.6-hd
MiniMax Speech-2.6-hd 异步语音合成
curl --request POST \
  --url https://api.highwayapi.ai/v3/async/minimax-speech-2.6-hd \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "text": "<string>",
  "voice_setting": {
    "speed": 123,
    "vol": 123,
    "pitch": 123,
    "voice_id": "<string>",
    "emotion": "<string>",
    "text_normalization": true
  },
  "audio_setting": {
    "sample_rate": 123,
    "bitrate": 123,
    "format": "<string>",
    "channel": 123
  },
  "pronunciation_dict": {
    "tone": [
      {}
    ]
  },
  "language_boost": "<string>",
  "voice_modify": {
    "pitch": 123,
    "intensity": 123,
    "timbre": 123,
    "sound_effects": "<string>"
  }
}
'
import requests

url = "https://api.highwayapi.ai/v3/async/minimax-speech-2.6-hd"

payload = {
    "text": "<string>",
    "voice_setting": {
        "speed": 123,
        "vol": 123,
        "pitch": 123,
        "voice_id": "<string>",
        "emotion": "<string>",
        "text_normalization": True
    },
    "audio_setting": {
        "sample_rate": 123,
        "bitrate": 123,
        "format": "<string>",
        "channel": 123
    },
    "pronunciation_dict": { "tone": [{}] },
    "language_boost": "<string>",
    "voice_modify": {
        "pitch": 123,
        "intensity": 123,
        "timbre": 123,
        "sound_effects": "<string>"
    }
}
headers = {
    "Content-Type": "<content-type>",
    "Authorization": "<authorization>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
  body: JSON.stringify({
    text: '<string>',
    voice_setting: {
      speed: 123,
      vol: 123,
      pitch: 123,
      voice_id: '<string>',
      emotion: '<string>',
      text_normalization: true
    },
    audio_setting: {sample_rate: 123, bitrate: 123, format: '<string>', channel: 123},
    pronunciation_dict: {tone: [{}]},
    language_boost: '<string>',
    voice_modify: {pitch: 123, intensity: 123, timbre: 123, sound_effects: '<string>'}
  })
};

fetch('https://api.highwayapi.ai/v3/async/minimax-speech-2.6-hd', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.highwayapi.ai/v3/async/minimax-speech-2.6-hd",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'text' => '<string>',
    'voice_setting' => [
        'speed' => 123,
        'vol' => 123,
        'pitch' => 123,
        'voice_id' => '<string>',
        'emotion' => '<string>',
        'text_normalization' => true
    ],
    'audio_setting' => [
        'sample_rate' => 123,
        'bitrate' => 123,
        'format' => '<string>',
        'channel' => 123
    ],
    'pronunciation_dict' => [
        'tone' => [
                [
                                
                ]
        ]
    ],
    'language_boost' => '<string>',
    'voice_modify' => [
        'pitch' => 123,
        'intensity' => 123,
        'timbre' => 123,
        'sound_effects' => '<string>'
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <authorization>",
    "Content-Type: <content-type>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.highwayapi.ai/v3/async/minimax-speech-2.6-hd"

	payload := strings.NewReader("{\n  \"text\": \"<string>\",\n  \"voice_setting\": {\n    \"speed\": 123,\n    \"vol\": 123,\n    \"pitch\": 123,\n    \"voice_id\": \"<string>\",\n    \"emotion\": \"<string>\",\n    \"text_normalization\": true\n  },\n  \"audio_setting\": {\n    \"sample_rate\": 123,\n    \"bitrate\": 123,\n    \"format\": \"<string>\",\n    \"channel\": 123\n  },\n  \"pronunciation_dict\": {\n    \"tone\": [\n      {}\n    ]\n  },\n  \"language_boost\": \"<string>\",\n  \"voice_modify\": {\n    \"pitch\": 123,\n    \"intensity\": 123,\n    \"timbre\": 123,\n    \"sound_effects\": \"<string>\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "<content-type>")
	req.Header.Add("Authorization", "<authorization>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/async/minimax-speech-2.6-hd")
  .header("Content-Type", "<content-type>")
  .header("Authorization", "<authorization>")
  .body("{\n  \"text\": \"<string>\",\n  \"voice_setting\": {\n    \"speed\": 123,\n    \"vol\": 123,\n    \"pitch\": 123,\n    \"voice_id\": \"<string>\",\n    \"emotion\": \"<string>\",\n    \"text_normalization\": true\n  },\n  \"audio_setting\": {\n    \"sample_rate\": 123,\n    \"bitrate\": 123,\n    \"format\": \"<string>\",\n    \"channel\": 123\n  },\n  \"pronunciation_dict\": {\n    \"tone\": [\n      {}\n    ]\n  },\n  \"language_boost\": \"<string>\",\n  \"voice_modify\": {\n    \"pitch\": 123,\n    \"intensity\": 123,\n    \"timbre\": 123,\n    \"sound_effects\": \"<string>\"\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.highwayapi.ai/v3/async/minimax-speech-2.6-hd")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n  \"text\": \"<string>\",\n  \"voice_setting\": {\n    \"speed\": 123,\n    \"vol\": 123,\n    \"pitch\": 123,\n    \"voice_id\": \"<string>\",\n    \"emotion\": \"<string>\",\n    \"text_normalization\": true\n  },\n  \"audio_setting\": {\n    \"sample_rate\": 123,\n    \"bitrate\": 123,\n    \"format\": \"<string>\",\n    \"channel\": 123\n  },\n  \"pronunciation_dict\": {\n    \"tone\": [\n      {}\n    ]\n  },\n  \"language_boost\": \"<string>\",\n  \"voice_modify\": {\n    \"pitch\": 123,\n    \"intensity\": 123,\n    \"timbre\": 123,\n    \"sound_effects\": \"<string>\"\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "task_id": "<string>"
}
该 API 支持基于文本到语音的异步生成,单次文本生成传输最大支持 100 万字符,生成的完整音频结果支持异步的方式进行检索。支持 100+系统音色、复刻音色自主选择;支持语调、语速、音量、比特率、采样率、输出格式自主调整。 提交长文本语音合成请求后,需要注意的是返回的 url 的有效期为自 url 返回开始的 24 个小时,请注意下载信息的时间。
适用于整本书籍等长文本的语音生成,任务排队耗时可能会较长。短句生成、语音聊天、在线社交等场景,建议使用 同步调用语音合成

请求头

Content-Type
string
必填
枚举值: application/json
Authorization
string
必填
Bearer 身份验证格式: Bearer {{API 秘钥}}。

请求体

text
string
必填
待合成的文本,限制最长 5 万字符。
voice_setting
object
必填
audio_setting
object
pronunciation_dict
object
language_boost
string
默认值:"null"
增强对指定的小语种和方言的识别能力,设置后可以提升在指定小语种/方言场景下的语音表现。如果不明确小语种类型,则可以选择”auto”,模型将自主判断小语种类型。支持以下取值:'Chinese', 'Chinese,Yue', 'English', 'Arabic', 'Russian', 'Spanish', 'French', 'Portuguese', 'German', 'Turkish', 'Dutch', 'Ukrainian', 'Vietnamese', 'Indonesian', 'Japanese', 'Italian', 'Korean', 'Thai', 'Polish', 'Romanian', 'Greek', 'Czech', 'Finnish', 'Hindi', 'Bulgarian', 'Danish', 'Hebrew', 'Malay', 'Persian', 'Slovak', 'Swedish', 'Croatian', 'Filipino', 'Hungarian', 'Norwegian', 'Slovenian', 'Catalan', 'Nynorsk', 'Tamil', 'Afrikaans', 'auto'
voice_modify
object
声音效果器设置,该参数支持的音频格式:mp3, wav, flac

响应信息参数

task_id
string
必填
异步任务的 task_id。您应该使用该 task_id 请求 查询任务结果 API 以获取生成结果