Create text-to-speech audio stream token and payload

December 23, 2024 (August 24, 2026)

Table of contents

  1. Request Headers
  2. Request Body
  3. Model Comparison: Speech
  4. Responses
  5. Examples
  6. Model
  7. Try It

This endpoint still works and is not going away, but it is no longer the recommended way to stream speech. POST speech/create with stream returns the same audio over Server-Sent Events in a single call, needs no WebSocket client, and hands you the audioId so the generation stays retrievable afterwards. Use it instead unless you are maintaining an existing WebSocket integration.

This endpoint creates a near real-time audio stream from the provided text.

  • The first audio arrives about four seconds in.
  • Concurrent generations are limited per account. This endpoint only mints a token, so it always succeeds — the limit is enforced when the generation starts on WSS speech/wss, which reports it as a MiniMax statusInfo frame rather than an HTTP status. The ceiling depends on the MiniMax plan. A free account allows three.

600+ pre-built voices provided by GET speech/voices, tagged for filtering with tag_list:

  • Languages: 40, from English, Chinese (Mandarin and Cantonese), Japanese and Korean through to Thai, Hindi, Tamil and Afrikaans
  • Emotions: happy, sad, angry, fearful, disgusted, surprised, neutral, fluent
  • Accents: EN-US (General), EN-Australian, EN-British, EN-Indian, CN-Northern, CN-Southern
  • Ages: Child, Young, Middle-aged, Elderly
  • Genders: Male, Female

tag_list matches these strings exactly, including case. A tag it does not recognise is ignored rather than rejected, so a typo silently widens the result instead of narrowing it — Female,Middle-Aged returns the same 310 voices as Female alone, spanning every age. Check the count when you add a filter. GET speech/config returns the tags the picker UI offers, updated as MiniMax adds to them. Voices carry others besides — Documentary, Calm and Adult all match voices without appearing there.

Returned by this endpoint token and payload will be used by WebSocket WSS speech/wss.

https://api.useapi.net/v1/minimax/speech/create-stream

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
Request Body
{
    "account": "Optional MiniMax www.minimax.io/audio API account",
    "text": "Required text",
    "voice_id": "Required voice id"
}
  • account is optional when only one account configured. However, if you have multiple accounts configured, this parameter becomes required.

  • text is required, the words to speak. Max length depends on the model — 5000 for hd, 10000 for turbo. Supports inline markup for emotion, sounds and pauses — for example <#0.5#> inserts a half-second pause.
    If you would rather not implement a WebSocket client, POST speech/create accepts the same text and returns either an audioId or a Server-Sent Events stream.

  • voice_id is required. Use GET speech/voices to get list of all available voices.

  • model is optional. Default: speech-2.8-hd. See Model Comparison below for the ten models, their character ceilings and their credit ratios.

  • language_boost is optional. Use tag_name from array voice_tag_language of GET speech/config.
    Default value Auto.

  • emotion is optional. Use value from array t2a_emotion of GET speech/config.
    Default value Auto.

  • vol is optional.
    Default 1.

  • speed is optional.
    Valid range: 0.5…2, default 1.

  • pitch is optional.
    Valid range: -12…12, default 0.

  • deepen_lighten is optional.
    Valid range: -100…100, default 0.

  • stronger_softer is optional.
    Valid range: -100…100, default 0.

  • nasal_crisp is optional.
    Valid range: -100…100, default 0.

  • spacious_echo is optional.
    Supported values: true, false (default).

  • lofi_telephone is optional.
    Supported values: true, false (default).

  • robotic is optional.
    Supported values: true, false (default).

  • auditorium_echo is optional.
    Supported values: true, false (default).

Model Comparison: Speech
Model Max characters Credits per character Status
speech-2.8-hd 5,000 1 Current, and the default
speech-2.8-turbo 10,000 0.6 Current
speech-2.6-hd 5,000 1 Previous generation
speech-2.6-turbo 10,000 0.6 Previous generation
speech-2.5-hd-preview 5,000 1 Superseded by 2.6
speech-2.5-turbo-preview 10,000 0.6 Superseded by 2.6
speech-02-hd 5,000 1 Legacy
speech-02-turbo 10,000 0.6 Legacy
speech-01-hd 5,000 1 Legacy
speech-01-turbo 10,000 0.6 Legacy

Use speech-2.8-hd unless you have a reason not to. The older models stay selectable because they are still live at MiniMax, and because regenerating audio to match something made earlier needs the model that made it — not because they are worth picking for new work.

Within a generation, hd and turbo are the same model tuned differently. turbo costs 40% less per character and accepts twice the text in a single call. It is not measurably faster — on identical 990-character text the two came out level — so pick turbo for the cheaper rate and the higher ceiling, and hd when voice quality matters most.

Sending more than a model accepts returns 400 before anything is generated, so an oversized request never costs credits. The message names the model and its limit — Parameter text length (5001) exceeds 5000 characters for model speech-2.8-hd — except at the absolute 10,000 ceiling, which is checked first and reports the limit without the model.

Responses
  • 200 OK

    Field token and payload values are used by WebSocket WSS speech/wss.

    • The token contains WebSocket authorization information and will expire in 24 hours.
    • The payload contains a properly formed and validated payload built from user-provided input. You should send this payload over the WebSocket to generate a real-time sound stream and optionally retrieve the generated MP3 file.
    {
        "token": "token for WSS WebSocket endpoint",
        "payload": {
            "msg_id": "1e53d-a593-e40b9-54e20-f29c84-40ae3",
            "payload": {
                "model": "",
                "text": "Text for TTS generation",
                "voice_setting": {
                    "speed": 1,
                    "vol": 1,
                    "pitch": 0,
                    "voice_id": "123456789",
                    "emotion": "happy"
                },
                "audio_setting": {},
                "effects": {
                    "deepen_lighten": 0,
                    "stronger_softer": 0,
                    "nasal_crisp": 0,
                    "spacious_echo": false,
                    "lofi_telephone": false,
                    "robotic": false,
                    "auditorium_echo": false
                },
                "er_weights": [],
                "language_boost": "German",
                "stream": true
            }
        }
    }
    
  • 400 Bad Request

    {
      "error": "<Error message>"
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized"
    }
    
  • 596 Account Error

    {
      "error": "Your minimax account has pending error. Please address this issue at https://useapi.net/docs/api-minimax-v1/post-minimax-accounts-account before making any new API calls.",
      "code": 596
    }
    
Examples

The code provided at WSS speech/wss is used on this page when you use the Try It feature.

Model

Field token and payload values are used by WebSocket WSS speech/wss.

  • The token contains WebSocket authorization information and will expire in 24 hours.
  • The payload contains a properly formed and validated payload built from user-provided input. You should send this payload over the WebSocket to generate a real-time sound stream and optionally retrieve the generated MP3 file.
{ // TypeScript, all fields are optional
  token: string
  payload: {}
}
Try It