Skip to content

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Text-to-Speech API: model comparison and examples

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

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

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-v4 Eleven v4: expressive single-voice narration, up to 2,000 characters prompt, voice_id (voice_daniel, voice_liam)
fish-s2-1-pro Fish Audio S2.1 Pro: long-form narration, up to 10,000 characters, billed per UTF-8 byte prompt, voice_id (voice_fish_narrator)
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"}'

Eleven v4 and Fish S2.1 Pro use the same shape with their own voice IDs:

curl -X POST "https://api.muapi.ai/api/v1/elevenlabs-v4" \
  -H "x-api-key: $MUAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Welcome to the future of voice.","voice_id":"voice_daniel"}'

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.