Speech synthesis
Convert text to speech with MiMo, select a voice and format, and control the delivery style.
Synthesize the specified text using Chat Completions format. Returns Base64 audio in non-streaming JSON or SSE streaming. For model IDs, see MiMo model guide.
/v1/chat/completionsPut the text to read in an assistant message. Optionally add a user message to control tone and style. Supports complete JSON and SSE audio deltas, with no polling.
Authorization
bearerAuth Use Bearer your-api-key in the Authorization Header.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
Text and voices
| Field | Usage |
|---|---|
messages | Put the text to read in a role: "assistant" message. An optional role: "user" message can describe tone, pace, or style; its content is not read aloud |
audio.voice | Select a preset voice; defaults to mimo_default. See the parameter list above for available values. Use voice IDs exactly as listed |
audio.format | Non-streaming defaults to wav and also supports mp3, pcm, and pcm16. Streaming defaults to pcm; explicitly setting pcm16 is recommended. pcm and pcm16 are equivalent |
| Style control | Describe naturalness, softness, or speaking rate in the user message, or add officially supported emotion or style tags to the text to read |
Read and play audio
| Mode | Handling |
|---|---|
| Non-streaming | Read Base64 from choices[].message.audio.data, decode it, and save or play it in the selected format; do not treat it as an audio URL |
| Streaming | Parse each SSE data: event, decode each choices[].delta.audio.data separately, and concatenate the audio bytes in order; do not concatenate Base64 strings directly |
| PCM playback | PCM16 is 24 kHz, mono, 16-bit little-endian audio. Configure playback accordingly, or add a WAV header before saving |
| Completion | Stop at data: [DONE]; also check finish_reason to distinguish normal completion, length limits, and content filtering |
Try it provides audio playback and download after the response finishes, with the original JSON or SSE on the right. The browser creates the audio in the current page; download it for long-term storage.