Skip to content

Create speech

OpenAI-compatible text-to-speech (MiniMax Speech 2.8 HD / Turbo, Doubao Speech); the response is the audio bytes directly.

POST/v1/audio/speech

Synthesizes text into audio synchronously; the response is the audio itself, with no task to poll. Works directly with the OpenAI SDK's audio.speech.create; only the Base URL and model / voice change. The two speech models belong to the separate MiniMax Speech Official group; a key must include that group to call them, and you can add it to an existing chat or video key.

Any other field returns 400 unknown field, including stream_format, sample_rate, language_boost and voice_setting. For those, streaming output or cloned voices, use the native endpoint POST /v1/t2a_v2; see the Text-to-speech guide. Billed per character: one Han character counts as 2 characters.

Doubao Speech seed-tts-2.0 (text to speech) and seed-audio-1.0 (audio from a scene description) belong to the separate Doubao Speech Cloud group and use only this endpoint: input is counted in characters, up to 5,000 for seed-tts-2.0 and 3,000 for seed-audio-1.0; speed is 0.5–2.0; the two models accept different response_format values; and failed requests are not billed. Switch the model picker above to "Doubao Speech" for its parameters; see the Text-to-speech guide · Doubao Speech.

Doubao Voice Cloning seed-icl-2.0, in the same group, also uses this endpoint: first clone a voice with Clone voice to get a voice_id starting with hbv_, then pass it as voice. Parameters and limits are the same as seed-tts-2.0; it is billed by input characters at the official price of ¥3 per 10,000 characters. See Doubao voice cloning.

The body is audio bytes, so the actual charge for this request is returned only in the X-HopBase-Cost / X-HopBase-Cost-USD / X-HopBase-Currency headers. See Account API · Charges.

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
Fields not listed are passed through unchanged. Pick a model family to see the values and limits its docs specify.
model:requiredstring

Case-sensitive, no aliases; tts-1 / tts-1-hd are not recognized

Valuesspeech-2.8-hdspeech-2.8-turboseed-tts-2.0seed-audio-1.0seed-icl-2.0

input:requiredstring

Text to synthesize (the native endpoint /v1/t2a_v2 allows up to 10000 characters)

Length1–4096 chars

voice:optionalstring

A system voice ID, a cloned voice ID, or an OpenAI voice name: alloy, ash, ballad, cedar, coral, echo, fable, marin, nova, onyx, sage, shimmer, verse (OpenAI voice names map to the default voice). Default: Chinese (Mandarin)_News_Anchor if the text contains Han characters, otherwise English_expressive_narrator

response_format:optionalstring

aac returns 400; opus is 24 kHz in an Ogg container

Valuesmp3opusflacwavpcm

Default"mp3"

speed:optionalnumber

Out-of-range values return 400; in-range values are clamped to 0.5–2

Range0.25–4Default1

instructions:optionalstring

Accepted but ignored

Returns

200Audio bytes. Content-Type follows response_format: audio/mpeg, audio/ogg, audio/flac, audio/wav, audio/pcm

Response headers

X-HopBase-Cost:optionalstring

The charge for this request in CNY (the same charge as X-HopBase-Cost-USD), up to 6 decimal places, such as 0.0816. Sent only when the request is charged; not sent on streaming (SSE) responses. When image generation takes longer than about 40 seconds the headers have already been sent, so read usage.cost in the body instead

X-HopBase-Cost-USD:optionalstring

The USD amount actually deducted from your balance for this request, the same amount as its usage record, up to 8 decimal places, such as 0.012; sent only together with X-HopBase-Cost

X-HopBase-Currency:optionalstring

The currency of X-HopBase-Cost, always CNY

audio/mpeg Audio bytes

Errors

400unknown field, input too long, speed out of range, unsupported response_format; for Doubao Speech, an unknown voice returns unknown_voice. For seed-icl-2.0: no cloned voice returns voice_required, a voice still being created or trained returns voice_not_ready, and a voice whose training failed returns voice_training_failed
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 60 MB (request_too_large)
429Account or key concurrency cap reached (user_concurrency_limit / apikey_concurrency_limit), with Retry-After

Related