curl -X POST https://api.60db.ai/tts-synthesize \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, this is a test of the Inworld-compatible text-to-speech API with streaming.",
"voice_id": "038cf0d1-eef8-45a6-81b0-99c5e57a33d2",
"audio_config": {
"audio_encoding": "LINEAR16",
"sample_rate_hertz": 24000
},
"speed": 1,
"wpm": 137,
"stability": 50,
"similarity": 75,
"timestamp_type": "WORD"
}'
import { SixtyDBClient } from "60db";
const client = new SixtyDBClient("your-api-key");
const audio = await client.textToSpeech({
text: "Hello, this is a test of the Inworld-compatible text-to-speech API with streaming.",
voice_id: "038cf0d1-eef8-45a6-81b0-99c5e57a33d2",
// model_id: "indic_tts_v1",
audio_config: {
audio_encoding: "LINEAR16",
sample_rate_hertz: 24000,
},
speed: 1,
wpm: 137, // optional words per minute (60–300)
stability: 50,
similarity: 75,
timestamp_type: "WORD",
});
// audio is an ArrayBuffer
from sixtydb import SixtyDBClient
client = SixtyDBClient('your-api-key')
audio = client.text_to_speech(
text='Hello, this is a test of the Inworld-compatible text-to-speech API with streaming.',
voice_id='038cf0d1-eef8-45a6-81b0-99c5e57a33d2',
# model_id='indic_tts_v1',
audio_config={
'audio_encoding': 'LINEAR16',
'sample_rate_hertz': 24000,
},
speed=1,
wpm=137, # optional words per minute (60–300)
stability=50,
similarity=75,
timestamp_type='WORD',
)
# Save to file
with open('output.wav', 'wb') as f:
f.write(audio)
{
"success": true,
"message": "Audio generated successfully",
"audio_base64": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4Ljc2LjEwMAAAAAAAAAAAAAAA...",
"sample_rate": 24000,
"duration_seconds": 3.5,
"encoding": "mp3",
"output_format": "mp3"
}
Text-to-Speech
Text to Speech
Convert text to natural-sounding speech
POST
/
tts-synthesize
curl -X POST https://api.60db.ai/tts-synthesize \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, this is a test of the Inworld-compatible text-to-speech API with streaming.",
"voice_id": "038cf0d1-eef8-45a6-81b0-99c5e57a33d2",
"audio_config": {
"audio_encoding": "LINEAR16",
"sample_rate_hertz": 24000
},
"speed": 1,
"wpm": 137,
"stability": 50,
"similarity": 75,
"timestamp_type": "WORD"
}'
import { SixtyDBClient } from "60db";
const client = new SixtyDBClient("your-api-key");
const audio = await client.textToSpeech({
text: "Hello, this is a test of the Inworld-compatible text-to-speech API with streaming.",
voice_id: "038cf0d1-eef8-45a6-81b0-99c5e57a33d2",
// model_id: "indic_tts_v1",
audio_config: {
audio_encoding: "LINEAR16",
sample_rate_hertz: 24000,
},
speed: 1,
wpm: 137, // optional words per minute (60–300)
stability: 50,
similarity: 75,
timestamp_type: "WORD",
});
// audio is an ArrayBuffer
from sixtydb import SixtyDBClient
client = SixtyDBClient('your-api-key')
audio = client.text_to_speech(
text='Hello, this is a test of the Inworld-compatible text-to-speech API with streaming.',
voice_id='038cf0d1-eef8-45a6-81b0-99c5e57a33d2',
# model_id='indic_tts_v1',
audio_config={
'audio_encoding': 'LINEAR16',
'sample_rate_hertz': 24000,
},
speed=1,
wpm=137, # optional words per minute (60–300)
stability=50,
similarity=75,
timestamp_type='WORD',
)
# Save to file
with open('output.wav', 'wb') as f:
f.write(audio)
{
"success": true,
"message": "Audio generated successfully",
"audio_base64": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4Ljc2LjEwMAAAAAAAAAAAAAAA...",
"sample_rate": 24000,
"duration_seconds": 3.5,
"encoding": "mp3",
"output_format": "mp3"
}
Request
Headers
string
required
Bearer token with your API key
string
required
application/json
Body
string
required
The text to convert to speech (max 5000 characters)
string
required
ID of the voice to use. Fetch available voices from
GET /voices.object
Nested audio configuration block (matches the upstream Inworld schema).
string
default:"LINEAR16"
Audio encoding for the streamed response. Options:
LINEAR16, OGG_OPUS.integer
default:"24000"
Output sample rate. Options:
16000, 24000, 48000.number
default:"1"
Speaking rate. Range
0.5 (slow) – 2.0 (fast). 1.0 = normal.number
Words per minute (optional). Target speaking rate in WPM. Range
60–300. When omitted, the voice’s default WPM is used (returned as wpm by GET /voices); voices without a measured default fall back to 137 WPM.integer
default:"50"
Voice consistency
0–100. 0 = expressive, 50 = balanced, 100 = consistent.integer
default:"75"
Voice match fidelity
0–100. 0 = loose, 75 = strong, 100 = exact clone.string
default:"WORD"
Set to
"WORD" to receive per-word timestamps in the final NDJSON chunk (timestampInfo). Omit or set to "NONE" to skip.string
Optional cross-lingual synthesis hint (e.g.
"en", "hi", "ar"). Required when the voice’s reference audio is in a different language than the input text. Auto-detected from voice metadata when omitted.Legacy flat keys (
sample_rate, audio_encoding) are still accepted for backwards-compatibility, but new integrations should send the nested audio_config object.Response
boolean
Indicates if the request was successful
string
Status message
string
Base64-encoded audio data
number
Audio sample rate in Hz
number
Duration of the audio in seconds
string
Audio encoding format
string
Audio output format
curl -X POST https://api.60db.ai/tts-synthesize \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, this is a test of the Inworld-compatible text-to-speech API with streaming.",
"voice_id": "038cf0d1-eef8-45a6-81b0-99c5e57a33d2",
"audio_config": {
"audio_encoding": "LINEAR16",
"sample_rate_hertz": 24000
},
"speed": 1,
"wpm": 137,
"stability": 50,
"similarity": 75,
"timestamp_type": "WORD"
}'
import { SixtyDBClient } from "60db";
const client = new SixtyDBClient("your-api-key");
const audio = await client.textToSpeech({
text: "Hello, this is a test of the Inworld-compatible text-to-speech API with streaming.",
voice_id: "038cf0d1-eef8-45a6-81b0-99c5e57a33d2",
// model_id: "indic_tts_v1",
audio_config: {
audio_encoding: "LINEAR16",
sample_rate_hertz: 24000,
},
speed: 1,
wpm: 137, // optional words per minute (60–300)
stability: 50,
similarity: 75,
timestamp_type: "WORD",
});
// audio is an ArrayBuffer
from sixtydb import SixtyDBClient
client = SixtyDBClient('your-api-key')
audio = client.text_to_speech(
text='Hello, this is a test of the Inworld-compatible text-to-speech API with streaming.',
voice_id='038cf0d1-eef8-45a6-81b0-99c5e57a33d2',
# model_id='indic_tts_v1',
audio_config={
'audio_encoding': 'LINEAR16',
'sample_rate_hertz': 24000,
},
speed=1,
wpm=137, # optional words per minute (60–300)
stability=50,
similarity=75,
timestamp_type='WORD',
)
# Save to file
with open('output.wav', 'wb') as f:
f.write(audio)
{
"success": true,
"message": "Audio generated successfully",
"audio_base64": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4Ljc2LjEwMAAAAAAAAAAAAAAA...",
"sample_rate": 24000,
"duration_seconds": 3.5,
"encoding": "mp3",
"output_format": "mp3"
}