API reference
Audio speech
POST /v1/audio/speech — text-to-speech synthesis.
POST
/v1/audio/speech
Synthesises speech from input text. Returns binary audio.
Request (JSON)
| Field | Type | Notes |
|---|---|---|
model | string | A TTS model id from your catalog, e.g. myt TTS. |
input | string | Text to synthesise. |
voice | string | A voice id supported by the model (model-specific — see the model detail page). |
response_format | string | Optional, model-dependent: mp3, opus, aac, flac, wav, pcm. |
speed | number | Optional, where supported. |
Response
Raw audio bytes with Content-Type matching the requested format.
Errors
400 for validation issues; 401 unauthorised; 429 rate limited.
Example
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>"}'