mistralM

Docs

sideBar

Speech Generation

Generate speech from text with a saved voice or a reference audio clip, and follow best practices for prompts and audio formats.

Generate speech from text using a saved voice (voice_id) or a one-off reference audio clip (ref_audio).

Generate

Generate speech using a previously saved voice (voice_id) identifier.

# Not available in the V1 SDK (mistralai 1.x).
# This feature requires the V2 SDK: pip install "mistralai>=2", then use the V2 tab.
# Migration guide: https://docs.mistral.ai/resources/migration-guides
Output
{
  "audio_data": "SUQzBAAAAAAAIlRTU0UAAAAOAAADTGF2ZjYxLjcu...<base64_encoded_audio>"
}

Best Practices

Text Prompt Guidelines

  • Language match: the voice prompt should be in the same language as the text prompt for best results.
  • Cross-lingual prompts: the model also supports cross-lingual voice transfer. For example, a French voice prompt with English text will produce French-accented English.
  • Verbalizable form: convert numbers and symbols to their spoken equivalent to avoid ambiguity. For example, use one thousand two hundred thirty four instead of 1234, or twelve thirty four depending on context.
  • No rich formatting: avoid markdown, emojis, or special characters in the text — they will not be rendered and may degrade output quality.
  • Abbreviations: spell out abbreviations for better pronunciation. Use F-B-I or F.B.I. instead of FBI.
  • Length: keep prompts under 300 words for best results.
exclamationMark

The TTS API includes content moderation. Requests containing certain text will be rejected with a 403 error. Keep your text inputs within acceptable use guidelines.

Response Audio Formats

Format

Description

mp3Compressed, suitable for most use cases
wavUncompressed PCM, highest quality
pcmRaw float32 LE samples — recommended for streaming (lowest latency)
flacLossless compression
opusLow bitrate, good for streaming