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-service";
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": "UklGRiQAAQBXQVZFZm10IBAAAAABAAEAwF0AAIC7AAACABAAZGF0YQAAAQA...",
"sample_rate": 24000,
"duration_seconds": 3.5,
"encoding": "LINEAR16",
"output_format": "wav",
"audioContent": "AAABAP7/AgD9/wMA..."
}
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-service";
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": "UklGRiQAAQBXQVZFZm10IBAAAAABAAEAwF0AAIC7AAACABAAZGF0YQAAAQA...",
"sample_rate": 24000,
"duration_seconds": 3.5,
"encoding": "LINEAR16",
"output_format": "wav",
"audioContent": "AAABAP7/AgD9/wMA..."
}
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:"48000"
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 request per-word timestamps (timestamp_info in the JSON response, timestampInfo in the final NDJSON chunk when streaming). Set to "NONE" to skip. Does not affect the audio fields.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.boolean
default:"true"
Polish the generated audio. On by default for every request. Set
false to skip it for the fastest result, for example when you feed the audio into a live voice agent. The older name enhance still works.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 file, ready to save or play. For
LINEAR16 this is a complete WAV file (16-bit PCM, mono, with header); for OGG_OPUS it is an Ogg file.number
Audio sample rate in Hz
number
Duration of the audio in seconds (
null for OGG_OPUS)string
Audio encoding:
LINEAR16 or OGG_OPUSstring
File format of
audio_base64: wav or oggstring
Legacy field kept for existing integrations: base64 of the raw engine audio (headerless 16-bit mono PCM for
LINEAR16). New integrations should use audio_base64.Streaming: send
"stream": true to receive newline-delimited JSON (application/x-ndjson) instead. Each line is {"result":{"audioContent":"<base64>"}} holding a chunk of headerless 16-bit mono PCM (for LINEAR16) at your sample rate; decode and concatenate the chunks in order.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-service";
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": "UklGRiQAAQBXQVZFZm10IBAAAAABAAEAwF0AAIC7AAACABAAZGF0YQAAAQA...",
"sample_rate": 24000,
"duration_seconds": 3.5,
"encoding": "LINEAR16",
"output_format": "wav",
"audioContent": "AAABAP7/AgD9/wMA..."
}