About
MiniMax Speech 02 Turbo is an earlier MiniMax low-latency text-to-speech model, listed by MiniMax as legacy; its language_boost does not include Persian, Filipino or Tamil. Infron serves it through the OpenAI-compatible POST /v1/audio/speech endpoint with any MiniMax voice ID, mp3, wav, flac, pcm or opus output and optional streaming. A request takes fewer than 10,000 characters and is billed per character (a Chinese character counts as 2).
1. Calling the API
Setup your API Key
To begin using Infron, create an account and generate your API Key.
export INFRON_KEY="YOUR_API_KEY"
Submit a request
Send JSON to POST https://llm.onerouter.pro/v1/audio/speech with your Infron API key. The request and response follow the OpenAI speech API, so the OpenAI SDKs work with the base URL https://llm.onerouter.pro/v1. The examples use the MiniMax voice female-tianmei. Replace YOUR_API_KEY with your key.
curl
curl https://llm.onerouter.pro/v1/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "minimax/speech-02-turbo/text-to-audio",
"voice": "female-tianmei",
"input": "Hello! Welcome to Infron.",
"response_format": "mp3"
}' \
--output speech.mp3
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://llm.onerouter.pro/v1",
api_key="YOUR_API_KEY",
)
with client.audio.speech.with_streaming_response.create(
model="minimax/speech-02-turbo/text-to-audio",
voice="female-tianmei",
input="Hello! Welcome to Infron.",
response_format="mp3",
) as response:
response.stream_to_file("speech.mp3")
TypeScript (OpenAI SDK)
import fs from "node:fs";
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://llm.onerouter.pro/v1",
apiKey: "YOUR_API_KEY",
});
const response = await client.audio.speech.create({
model: "minimax/speech-02-turbo/text-to-audio",
voice: "female-tianmei",
input: "Hello! Welcome to Infron.",
response_format: "mp3",
});
fs.writeFileSync("speech.mp3", Buffer.from(await response.arrayBuffer()));
Response
A successful request returns HTTP 200 with the audio file as the body, not JSON. Content-Type follows response_format: audio/mpeg for mp3, audio/wav for wav, audio/flac for flac, audio/pcm for pcm, audio/opus for opus. The examples above save it as speech.mp3.
Streaming
Add "stream_format": "sse" to receive Server-Sent Events while the audio is generated. Each speech.audio.delta event carries the next base64 chunk of the audio in response_format; decode the chunks and append them in order. The stream ends with a speech.audio.done event that reports usage.
curl https://llm.onerouter.pro/v1/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "minimax/speech-02-turbo/text-to-audio",
"voice": "female-tianmei",
"input": "Hello! Welcome to Infron.",
"response_format": "mp3",
"stream_format": "sse"
}' \
--no-buffer
data: {"type":"speech.audio.delta","audio":"<base64 audio chunk>"}
data: {"type":"speech.audio.delta","audio":"<base64 audio chunk>"}
data: {"type":"speech.audio.done","usage":{"input_tokens":25,"output_tokens":0,"total_tokens":25}}
In this example input_tokens is the billable character count of the input.
Routing and usage
This model is served by minimax (MiniMax). Billing uses MiniMax's billable character count (a Chinese character counts as 2). The audio response carries no usage; with streaming, speech.audio.done reports the billable count as usage.input_tokens.
Errors
Parameters this model does not accept are rejected with HTTP 400 before the request is sent to MiniMax, and nothing is charged. error.message explains the problem and ends with the request ID:
{
"error": {
"message": "voice is required (MiniMax voice_id) (request id: 20261111221810441285700pZnPkvCJ)",
"type": "infron_ai_error",
"param": "",
"code": "invalid_request_error"
}
}
Errors reported by MiniMax, such as an unknown voice ID, are returned with MiniMax's message. If a stream fails after it has started, an error event is sent instead of speech.audio.done.
2. Schema
Input
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
model | string | Yes | -- | minimax/speech-02-turbo/text-to-audio | Model ID. |
input | string | Yes | -- | Fewer than 10,000 characters | Text to synthesize. Pause with <#0.5#> (seconds, 0.01 to 99.99) and set pronunciation inline with pinyin or IPA in parentheses. |
voice | string | Yes | -- | -- | MiniMax voice ID (sent as voice_setting.voice_id), for example female-tianmei. System voice IDs are case-sensitive (see Sources); cloned and designed voices also work. Not required when timbre_weights is sent. |
response_format | string | No | mp3 | mp3, wav, flac, pcm, opus | Audio format. |
speed | number | No | 1 | 0.5 to 2.0 | Speaking rate. Sent as voice_setting.speed. |
sample_rate | integer | No | MiniMax default (opus: 24000) | 8000, 16000, 22050, 24000, 32000, 44100; opus: 8000, 16000, 24000 | Output sample rate. Sent as audio_setting.sample_rate. |
bit_rate | integer | No | MiniMax default | 32000, 64000, 128000, 256000 | MP3 bitrate in bps. Sent as audio_setting.bitrate. |
stream_format | string | No | audio | audio, sse | sse streams Server-Sent Events (see Streaming). |
MiniMax fields
These fields are not part of the OpenAI speech API. Put them at the top level of the JSON body; with the OpenAI Python SDK pass them in extra_body.
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
emotion | string | No | Chosen from the text | happy, sad, angry, fearful, disgusted, surprised, calm | Emotion of the speech. Sent as voice_setting.emotion. |
vol | number | No | 1 | Above 0, up to 10 | Volume. Sent as voice_setting.vol. |
pitch | integer | No | 0 | -12 to 12 | Pitch in semitones. Sent as voice_setting.pitch. |
language_boost | string | No | -- | e.g. auto, Chinese, Chinese,Yue, English, Japanese, Korean, Spanish; Persian, Filipino and Tamil are rejected with 400 | Improve recognition of a language or dialect; Chinese,Yue is needed for Cantonese voices. |
text_normalization_mode | string | No | -- | basic, quality | Number and symbol normalization; quality adds an LLM pass and is treated as basic on this model. |
text_normalization | boolean | No | false | true, false | Chinese and English number normalization (deprecated by MiniMax; text_normalization_mode wins). |
latex_read | boolean | No | false | true, false | Read LaTeX formulas in $$...$$ (Chinese only). |
pronunciation_dict | object | No | -- | -- | tone: list of original/replacement entries, e.g. omg/oh my god. |
timbre_weights | array | No | -- | Up to 4 voices, weight 1 to 100 | Mix voices: each item has voice_id and weight. Leave voice empty when it is used. |
voice_modify | object | No | -- | pitch, intensity, timbre -100 to 100 | Voice effects; sound_effects can be spacious_echo, auditorium_echo, lofi_telephone or robotic. |
channel | integer | No | 1 | 1, 2 | Mono or stereo. Sent as audio_setting.channel. |
force_cbr | boolean | No | false | true, false | Constant bitrate for streamed MP3. |
Unsupported fields
| Field | Behavior |
|---|---|
instructions, language | Ignored. Use emotion and language_boost. |
timbre_weights with weight 0 | Rejected with 400. |
| Other fields | Not forwarded to MiniMax. |
Output
| Parameter | Type | Range | Description |
|---|---|---|---|
| Response body | binary | mp3, wav, flac, pcm, opus | The audio file in response_format (without stream_format=sse). |
Content-Type header | string | audio/mpeg, audio/wav, audio/flac, audio/pcm, audio/opus | MIME type of the audio. |
type | string | speech.audio.delta, speech.audio.done, error | Streaming event type. |
audio | string | Base64 | Next chunk of the audio (speech.audio.delta). |
usage.input_tokens | integer | Non-negative | Billable count of the input (speech.audio.done). |
usage.output_tokens | integer | 0 | Always 0 for this model. |
usage.total_tokens | integer | Non-negative | Sum of input and output. |
error | object | -- | message, type and code of a failure (error event). |
3. Detailed Pricing
| Model | Endpoint | Billing unit | Price |
|---|---|---|---|
| MiniMax: Speech 02 Turbo | minimax | Per 1M characters | $60.00 |
Prices are in USD. Billing uses MiniMax's billable character count (a Chinese character counts as 2).
Sources: Text to speech HTTP API, System voice IDs, Pricing.