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

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.
  • curl and Python examples for asynchronous submission and result polling.
  • Practical guidance for scripts, dialogue formatting, retries, and temporary audio URLs.

Model comparison

EndpointBest forDistinguishing input
minimax-speech-2.6-hdHigh-quality single-speaker narrationprompt, voice_id
minimax-speech-2.6-turboFaster single-speaker narrationprompt, voice_id
elevenlabs-tts-turbo-2-5Expressive single-speaker speechprompt, voice_id, language/style controls
elevenlabs-text-to-dialogue-v3Dialogue with multiple speakersdialogue, language and voice controls
gemini-3-1-flash-ttsGemini Flash voice generationdialogue_turns, context, speakers
gemini-2-5-pro-ttsPro-tier Gemini speechdialogue_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

ProblemLikely cause
401 or 403Missing/invalid x-api-key or an inactive account.
Validation errorWrong voice field, dialogue shape, or unsupported language code.
Audio missing from final responsePoll the result endpoint and persist the returned URL immediately.
Dialogue sounds like one speakerUse 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.