Text-to-Speech API: model comparison and examples
August 20, 2026 · View on GitHub
Turn text and multi-speaker dialogue into audio with Muapi’s unified Text-to-Speech API. This repository compares the live voice endpoints and shows direct HTTP requests for single-voice narration and dialogue. It is documentation plus runnable examples; no SDK is required.
Open the Text-to-Speech API landing page · Get an API key · API reference
Related Projects
- Muapi Python — general Python API integration.
- AI Voice Agent — voice-agent workflows that can consume generated audio.
- Muapi CLI — command-line access to Muapi models.
- Speech-to-Text API examples — the companion transcription surface.
- Voice Cloning API examples — voice identity workflows.
What this repository covers
- Model selection for narration, fast speech, expressive speech, and multi-speaker dialogue.
- Request payloads, voice IDs, language options, and output handling.
curland Python examples for asynchronous submission and result polling.- Practical guidance for scripts, dialogue formatting, retries, and temporary audio URLs.
Model comparison
| Endpoint | Best for | Distinguishing input |
|---|---|---|
minimax-speech-2.6-hd | High-quality single-speaker narration | prompt, voice_id |
minimax-speech-2.6-turbo | Faster single-speaker narration | prompt, voice_id |
elevenlabs-tts-turbo-2-5 | Expressive single-speaker speech | prompt, voice_id, language/style controls |
elevenlabs-text-to-dialogue-v3 | Dialogue with multiple speakers | dialogue, language and voice controls |
gemini-3-1-flash-tts | Gemini Flash voice generation | dialogue_turns, context, speakers |
gemini-2-5-pro-tts | Pro-tier Gemini speech | dialogue_turns, context, speakers |
For current pricing, supported voices, and output limits, use the live page and the selected model’s playground/API schema. Do not hard-code a price into a production integration without rechecking it.
Quick start with curl
export MUAPI_API_KEY="your_key"
curl -X POST "https://api.muapi.ai/api/v1/minimax-speech-2.6-hd" \
-H "x-api-key: $MUAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"Welcome to the Muapi API.","voice_id":"female-shaonv"}'
The response contains a request identifier. Poll until the job reaches a terminal success state:
export REQUEST_ID="id_from_the_submission_response"
curl "https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result" \
-H "x-api-key: $MUAPI_API_KEY"
For multi-speaker output, use the dialogue model and its documented dialogue structure:
curl -X POST "https://api.muapi.ai/api/v1/elevenlabs-text-to-dialogue-v3" \
-H "x-api-key: $MUAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"dialogue":[{"speaker":"Host","text":"What is Muapi?"},{"speaker":"Guest","text":"One API for generative media models."}],"language_code":"en"}'
See examples/quickstart.py for a complete polling loop.
Production notes
- Keep narration text in your own durable store; result URLs may be temporary.
- Use a stable voice ID and language setting when comparing model quality.
- Break very long scripts into meaningful sections and preserve ordering metadata.
- Retry transport failures with bounded backoff, but do not blindly resubmit a job whose status is unknown.
- Get permission for voices and scripts that identify real people; voice generation does not grant identity rights.
Troubleshooting
| Problem | Likely cause |
|---|---|
401 or 403 | Missing/invalid x-api-key or an inactive account. |
| Validation error | Wrong voice field, dialogue shape, or unsupported language code. |
| Audio missing from final response | Poll the result endpoint and persist the returned URL immediately. |
| Dialogue sounds like one speaker | Use a dialogue-capable endpoint and keep speaker labels consistent. |
License
Documentation and examples are MIT licensed. Generated audio and model usage remain subject to the applicable Muapi and model-provider terms.