Skip to content

Text to speech

POST
/v1/audio/speech
curl --request POST \
--url https://api.mirapi.ai/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "model": "tts-1", "input": "example", "voice": "alloy", "response_format": "mp3", "speed": 1 }'

Converts text into audio

Media typeapplication/json
object
model
required
string
Example
tts-1
input
required

Text to convert

string
<= 4096 characters
voice
required
string
Allowed values: alloy echo fable onyx nova shimmer
response_format
string
default: mp3
Allowed values: mp3 opus aac flac wav pcm
speed
number
default: 1 >= 0.25 <= 4

Audio generated

Media typeaudio/mpeg
string format: binary