Convert text into natural-sounding spoken audio using TTS models.
Text-to-speech (TTS) generates spoken audio from any text input. Pass a string, choose a voice, and receive an audio file back — ready to stream, download, or embed in your application.
TTS is a dedicated endpoint, distinct from chat completions:
The response is the raw audio binary with the appropriate Content-Type header (e.g. audio/mpeg) and an X-Generation-Id header for tracing.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | A TTS model slug — filter the catalog with ?modality=speech |
input | string | Yes | The text to convert to speech (up to the model's character limit) |
voice | string | Yes | Voice preset name — varies by model |
response_format | string | No | Output format: mp3, pcm, wav, opus, flac, aac |
speed | number | No | Playback speed multiplier, 0.25–4.0 (default 1.0) |
TTS models vary widely in supported languages. Arabic (Modern Standard and Darija), French, and English are priority targets for the OpenDunes catalog. Each model's detail page at /models will list supported languages once TTS models are available.
TTS is billed in DA per character of input (the catalog quotes the rate as DA per million characters), varying by model and voice quality. Character count is known before the call, so the cost is settled deterministically. See the pricing reference and the model catalog.