Skip to content

Create T2A v2 audio

MiniMax T2A v2 native request body: full parameters, cloned voices and SSE streaming; audio in JSON responses is hex.

POST/v1/t2a_v2

Takes the MiniMax T2A v2 request body as is, so official SDK code works after changing the Base URL and key; fields the gateway does not know pass through unchanged, and JSON responses keep the official structure too (except errors). The two speech models belong to their own group, MiniMax Speech Official; keys for chat or video groups cannot reach them.

The gateway does only three things here: validates model, the text length, stream and output_format; clamps voice_setting.speed to the official range; and limits the request body to ≤1 MiB. Other fields with values outside the official range return 400 from the service.

data.audio is hex-encoded audio, and extra_info.usage_characters is the billed character count. Pass stream: true to switch to SSE: each data: {...} event carries a chunk of hex audio, and the final chunk has data.status 2 plus extra_info. If a stream fails midway, a last event with base_resp is pushed before the stream closes, and nothing is billed. See Streaming.

For a cloned voice, set voice_setting.voice_id (or timber_weights[].voice_id). The clone fee is charged once, with the voice's first successful synthesis, and the usage record details show an extra voice_clone_activation item. If you only need the OpenAI shape, use POST /v1/audio/speech.

Headers

Authorization:requiredstring

Bearer sk-…: an API key created in the console under API keys; its group must include the requested model

Body parametersJSON

model:requiredstring

Case-sensitive, no aliases

Valuesspeech-2.8-hdspeech-2.8-turbo

text:requiredstring

Text to synthesize; separate paragraphs with line breaks. Supports pause markers <#x#> (0.01–99.99 seconds), inline pronunciation and interjections; see the speech guide. Officially, streaming is recommended beyond 3000 characters

Length1–10000 chars

stream:optionalboolean

When true, the response switches to SSE

Defaultfalse

stream_options:optionalobject

Streaming options

language_boost:optionalstring

Improves recognition of that language or dialect; auto lets the model decide. Cantonese voices need Chinese,Yue. Not set when omitted

ValuesautoChineseChinese,YueEnglishArabicRussianSpanishFrenchPortugueseGermanTurkishDutchUkrainianVietnameseIndonesianJapaneseItalianKoreanThaiPolishRomanianGreekCzechFinnishHindiBulgarianDanishHebrewMalayPersianSlovakSwedishCroatianFilipinoHungarianNorwegianSlovenianCatalanNynorskTamilAfrikaans

pronunciation_dict:optionalobject

Pronunciation dictionary

voice_modify:optionalobject

Voice modification, passed through with the official semantics; not validated by the gateway

output_format:optionalstring

Only hex is supported; url returns 400

Valueshex

Default"hex"

voice_setting:optionalobject

Voice settings

audio_setting:optionalobject

Audio settings

Returns

200JSON when non-streaming; text/event-stream with stream: true, where each event's data has the same shape as below

data:optionalobject
extra_info:optionalobject

Audio metadata and billed character count

base_resp:optionalobject

{"status_code": 0, "status_msg": "success"} on success; errors do not come here but as a non-200 status code with an error object

Errors

400Unsupported model, empty text or over 10000 characters, output_format other than hex, nonexistent voice ID, opus without sample_rate, values outside the official range, sensitive content, etc.
401Missing, invalid or expired API key (missing_api_key / invalid_api_key / api_key_expired)
402Balance, or key / member / department quota, exhausted (insufficient_quota)
404The model is not in this key's group (model_not_found), or the path does not belong to the group (route_not_found)
413Request body over 1 MiB: request body exceeds the 1048576 byte limit (got N bytes)
429Account or key concurrency cap reached (user_concurrency_limit / apikey_concurrency_limit), with Retry-After
502Audio over 64 MiB (response_size_limit_exceeded): use stream: true, shorten the text or lower the bitrate
503No service currently available: back off and retry (2 s, 5 s, 15 s, up to three times)

Related