myt AI Cloud

By Mauritius Telecom

Beta
⌘K
Core features

Text to speech

Synthesise speech from text and receive an audio file in return.

POST

/v1/audio/speech

Converts input text into spoken audio. Returns raw audio bytes in the requested format.

Request body

FieldTypeRequiredNotes
modelstringYesA TTS model id from your catalog (e.g. myt TTS).
inputstringYesText to synthesise.
voicestringYesA voice id supported by the model. Available voices are model-specific — open the model's detail page in the catalog to see its voices.
response_formatstringNoAudio format (model-dependent), e.g. mp3 (default), opus, aac, flac, wav, pcm.
speednumberNoPlayback speed multiplier, where the model supports it. Default 1.0.

Example request

{
  "model": "myt TTS",
  "input": "Welcome to myt AI Cloud. Your gateway to AI models.",
  "voice": "<voice-id>",
  "response_format": "mp3"
}

Response

The response body is raw audio bytes. The Content-Type header matches the requested format (e.g. audio/mpeg for mp3). Write the bytes directly to a file.

curl -sS --request "POST" \
  --url "$MYT_BASE_URL/audio/speech" \
  --header "Authorization: Bearer $MYT_API_KEY" \
  --header "Content-Type: application/json" \
  --output "speech.mp3" \
  --data '{"model":"myt TTS","input":"Hello from myt AI Cloud.","voice":"<voice-id>"}'

Errors

StatusWhen
400Input too long, unsupported voice or format
401API key missing or invalid
429Rate limit or budget exceeded

Code examples

curl -sS --request "POST" \
  --url "$MYT_BASE_URL/audio/speech" \
  --header "Authorization: Bearer $MYT_API_KEY" \
  --header "Content-Type: application/json" \
  --output "speech.mp3" \
  --data '{"model":"myt TTS","input":"Hello from myt AI Cloud.","voice":"<voice-id>"}'

Full parameter reference: Audio speech.

On this page