inworld/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
post
Authorizations
AuthorizationstringRequired
Bearer key
Body
modelundefined · enumRequiredPossible values:
textstring · min: 1 · max: 500000Required
The text content to be converted to speech.
voicestring · enumOptionalDefault:
Name of the voice to be used.
AlexPossible values: formatstring · enumOptionalDefault:
Audio output format. WAV delivers uncompressed audio in a widely supported container format, while MP3 provides good compression and compatibility.
mp3Possible values: Responses
201Success
application/json
post
/v1/ttsasync function main() {
const response = await fetch('https://api.aimlapi.com/v1/tts', {
method: 'POST',
headers: {
'Authorization': 'Bearer <YOUR_API_KEY>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "inworld/tts-1",
"text": "Cities of the future promise to radically transform how people live, work, and move. Instead of sprawling layouts, we’ll 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."
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();201Success
{
"metadata": {
"transaction_key": "text",
"request_id": "text",
"sha256": "text",
"created": "2025-11-28T13:07:58.437Z",
"duration": 1,
"channels": 1,
"models": [
"text"
],
"model_info": {
"ANY_ADDITIONAL_PROPERTY": {
"name": "text",
"version": "text",
"arch": "text"
}
}
}
}Code Example
import requests
# Insert your AI/ML API key instead of <YOUR_AIMLAPI_KEY>:
api_key = "<YOUR_AIMLAPI_KEY>"
base_url = "https://api.aimlapi.com/v1"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
}
data = {
"model": "inworld/tts-1",
"text": "It is a fast and powerful language model. Use it to convert text to natural sounding spoken text.",
"voice": "Deborah",
}
response = requests.post(f"{base_url}/tts", headers=headers, json=data)
response.raise_for_status()
result = response.json()
print("Audio URL:", result["audio"]["url"])import axios from "axios";
// Insert your AI/ML API key instead of <YOUR_AIMLAPI_KEY>:
const apiKey = "<YOUR_API_KEY>";
const baseURL = "https://api.aimlapi.com/v1";
const headers = {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
};
const data = {
model: "inworld/tts-1",
text: "It is a fast and powerful language model. Use it to convert text to natural sounding spoken text.",
voice: "Deborah",
};
const main = async () => {
const response = await axios.post(`${baseURL}/tts`, data, { headers });
console.log("Audio URL:", response.data.audio.url);
};
main().catch(console.error);Listen to the audio sample we generated (~ 3 s):
Last updated
Was this helpful?