TTS 1
This model is designed for realtime text-to-speech generation.
Setup your API Key
If you don’t have an API key for the AI/ML API yet, feel free to use our Quickstart guide.
API Schema
The text content to be converted to speech.
Name of the voice to be used.
alloyPossible values: Determines the style exaggeration of the voice. This setting attempts to amplify the style of the original speaker. It does consume additional computational resources and might increase latency if set to anything other than 0.
Format of the output content for non-streaming requests. Controls how the generated audio data is encoded in the response.
mp3Possible values: Adjusts the speed of the voice. A value of 1.0 is the default speed, while values less than 1.0 slow down the speech, and values greater than 1.0 speed it up.
1falsePossible values: curl -L \
--request POST \
--url 'https://api.aimlapi.com/v1/tts' \
--header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "openai/tts-1",
"text": "Cities of the future promise to radically transform how people live, work, and move. Instead of sprawling layouts, we will see vertical structures that integrate residential, work, and public spaces into single, self-sustaining ecosystems. Architecture will adapt to climate conditions, and buildings will be energy-efficient—generating power through solar panels, wind turbines, and even foot traffic."
}'{
"audio": "https://example.com",
"meta": {
"usage": {
"credits_used": 120000,
"usd_spent": 0.06
}
}
}Code Example
Listen to the audio sample we generated:
Last updated
Was this helpful?