Skip to content

Synchronous Speech Synthesis V2

POST https://www.kkiai.com/minimax/v1/t2a_v2

https://platform.minimaxi.com/docs/api-reference/speech-t2a-http

Request Parameters

Authorization

Add the Authorization parameter to the Header. Its value should be the Token concatenated after Bearer.

Example: Authorization: Bearer ********************

Header Parameters

Parameter NameTypeRequiredDescriptionExample
Content-Typeenum<string>RequiredThe media type of the request body. Must be set to application/json to ensure the request data is in JSON formatapplication/json

Request Example

json
{
    "model": "speech-02-hd",
    "text": "Hello, welcome to the text-to-speech service!",
    "voice_setting": {
        "voice_id": "moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85"
    }
}

cURL Example

bash
curl --location --request POST 'https://www.kkiai.com/minimax/v1/t2a_v2' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "speech-02-hd",
    "text": "Hello, welcome to the text-to-speech service!",
    "voice_setting": {
        "voice_id": "moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85"
    }
}'

Response

🟢200

Response Example

json
{
    "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"
    }
}