Skip to main content
POST
/
v3
/
minimax-speech-02-turbo
MiniMax Speech-02-turbo Synchronous Speech Synthesis
curl --request POST \
  --url https://api.highwayapi.ai/v3/minimax-speech-02-turbo \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "text": "<string>",
  "voice_setting": {
    "speed": 123,
    "vol": 123,
    "pitch": 123,
    "voice_id": "<string>",
    "emotion": "<string>",
    "latex_read": true,
    "text_normalization": true
  },
  "audio_setting": {
    "sample_rate": 123,
    "bitrate": 123,
    "format": "<string>",
    "channel": 123
  },
  "pronunciation_dict": {
    "tone": [
      {}
    ]
  },
  "timbre_weights": [
    {
      "voice_id": "<string>",
      "weight": 123
    }
  ],
  "stream": true,
  "stream_options": {
    "exclude_aggregated_audio": true
  },
  "language_boost": "<string>",
  "output_format": "<string>",
  "voice_modify": {
    "pitch": 123,
    "intensity": 123,
    "timbre": 123,
    "sound_effects": "<string>"
  }
}
'
{
  "audio": "<string>",
  "status": 123
}
This API supports synchronous text-to-speech generation, with a maximum of 10,000 characters per text submission. It supports 100+ system voices and selectable cloned voices; adjustment of volume, pitch, speed, and output format; proportional voice mixing and fixed interval control; multiple audio specifications and formats, including mp3, pcm, flac, and wav; and streaming output. After submitting a long-text speech synthesis request, note that the returned url is valid for 24 hours from the time the url is returned. Please download the information in time.
Suitable for scenarios such as short sentence generation, voice chat, and online social interaction. It has low latency, but the text length is limited to less than 10,000 characters. For long text, we recommend using asynchronous speech synthesis.

Request Headers

Content-Type
string
required
Enum value: application/json
Authorization
string
required
Bearer authentication format: Bearer {{API Key}}.

Request Body

text
string
required
The text to synthesize. The length limit is less than 10,000 characters. Use line breaks to separate paragraphs. (If you need to control the interval time within the speech, add <#x#> between characters, where x is in seconds. Supported range: 0.01–99.99, with up to two decimal places.) Custom speech time intervals between text segments are supported to achieve custom pause durations in synthesized speech. Note that the text interval must be set between two pieces of pronounceable text, and multiple consecutive time intervals cannot be set.
voice_setting
object
required
audio_setting
object
pronunciation_dict
object
timbre_weights
object[]
Required as an alternative to voice_id
stream
boolean
default:"false"
Whether to stream. Default is false, meaning streaming is not enabled.
stream_options
object
language_boost
string
default:"null"
Enhances recognition capability for the specified low-resource language or dialect. After setting it, speech performance can be improved in the specified low-resource language/dialect scenario. If the language type is not clear, you can select “auto”, and the model will determine the language type automatically. Supported values:'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'
output_format
string
default:"hex"
Parameter that controls the output result format. Optional values are url and hex. Default value is hex. This parameter only takes effect in non-streaming scenarios. Streaming scenarios only support returning results in hex format. The returned url is valid for 24 hours.
voice_modify
object
Voice effects settings. This parameter supports the following audio formats:
  • Non-streaming: mp3, wav, flac
  • Streaming: mp3

Response Information

audio
string
The synthesized audio segment, encoded in hex and generated according to the input-defined format (audio_setting.format) (mp3/pcm/flac). The return format depends on the definition of output_format. When stream is true, only hex return format is supported.
status
number
The current audio stream status, returned only when stream is true. 1 indicates synthesis in progress, and 2 indicates synthesis has ended.