cURL
curl 'https://api.inworld.ai/tts/v1/voice:preview?voice_id=Ashley&model_id=inworld-tts-2' \
--header "Authorization: Basic $INWORLD_API_KEY" \
| jq -r '.audioContent' | base64 -d > preview.mp3import requests
import base64
import os
url = "https://api.inworld.ai/tts/v1/voice:preview"
headers = {
"Authorization": f"Basic {os.getenv('INWORLD_API_KEY')}"
}
params = {
"voice_id": "Ashley",
"model_id": "inworld-tts-2"
}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
audio_content = base64.b64decode(response.json()["audioContent"])
with open("preview.mp3", "wb") as f:
f.write(audio_content)
print("Preview saved to preview.mp3")const fs = require('fs');
async function main() {
const url = 'https://api.inworld.ai/tts/v1/voice:preview?voice_id=Ashley&model_id=inworld-tts-2';
const response = await fetch(url, {
headers: {
'Authorization': `Basic ${process.env.INWORLD_API_KEY}`,
},
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const result = await response.json();
const audioBuffer = Buffer.from(result.audioContent, 'base64');
fs.writeFileSync('preview.mp3', audioBuffer);
console.log('Preview saved to preview.mp3');
}
main();{
"audioContent": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYwLjE2LjEwMAAAAAAAAAAAAAAA..."
}{
"code": 5,
"message": "Unknown voice: John not found!",
"details": []
}Voices
Get voice preview
Returns a short audio preview for an existing voice. The preview text is determined server-side and cannot be customized. This endpoint is not metered or billed, making it ideal for voice browsing and selection experiences. Audio is always returned in MP3 format.
GET
/
tts
/
v1
/
voice:preview
cURL
curl 'https://api.inworld.ai/tts/v1/voice:preview?voice_id=Ashley&model_id=inworld-tts-2' \
--header "Authorization: Basic $INWORLD_API_KEY" \
| jq -r '.audioContent' | base64 -d > preview.mp3import requests
import base64
import os
url = "https://api.inworld.ai/tts/v1/voice:preview"
headers = {
"Authorization": f"Basic {os.getenv('INWORLD_API_KEY')}"
}
params = {
"voice_id": "Ashley",
"model_id": "inworld-tts-2"
}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
audio_content = base64.b64decode(response.json()["audioContent"])
with open("preview.mp3", "wb") as f:
f.write(audio_content)
print("Preview saved to preview.mp3")const fs = require('fs');
async function main() {
const url = 'https://api.inworld.ai/tts/v1/voice:preview?voice_id=Ashley&model_id=inworld-tts-2';
const response = await fetch(url, {
headers: {
'Authorization': `Basic ${process.env.INWORLD_API_KEY}`,
},
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const result = await response.json();
const audioBuffer = Buffer.from(result.audioContent, 'base64');
fs.writeFileSync('preview.mp3', audioBuffer);
console.log('Preview saved to preview.mp3');
}
main();{
"audioContent": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYwLjE2LjEwMAAAAAAAAAAAAAAA..."
}{
"code": 5,
"message": "Unknown voice: John not found!",
"details": []
}Authorizations
Your authentication credentials. For Basic authentication, please populate Basic $INWORLD_API_KEY. You can create a key in one command with the Inworld CLI: inworld workspace add-key.
Query Parameters
The identifier of the voice to preview. Use the List Voices endpoint to discover available voice IDs.
Example:
"Ashley"
Response
A successful response containing the voice preview audio.
The audio data bytes encoded as MP3. The preview text is determined server-side and cannot be customized.
⌘I