curl -X POST https://api.60db.ai/tts-synthesize \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, world! This is a test of the text to speech API.",
"voice_id": "default-voice",
"enhance": true,
"speed": 1.0
}'
import { SixtyDBClient } from "60db";
const client = new SixtyDBClient("your-api-key");
const audio = await client.textToSpeech({
text: "Hello, world! This is a test of the text to speech API.",
voice_id: "default-voice",
enhance: true,
speed: 1.0,
});
// audio is an ArrayBuffer
from sixtydb import SixtyDBClient
client = SixtyDBClient('your-api-key')
audio = client.text_to_speech(
text='Hello, world! This is a test of the text to speech API.',
voice_id='default-voice',
enhance=True,
speed=1.0
)
# Save to file
with open('output.mp3', '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, world! This is a test of the text to speech API.",
"voice_id": "default-voice",
"enhance": true,
"speed": 1.0
}'
import { SixtyDBClient } from "60db";
const client = new SixtyDBClient("your-api-key");
const audio = await client.textToSpeech({
text: "Hello, world! This is a test of the text to speech API.",
voice_id: "default-voice",
enhance: true,
speed: 1.0,
});
// audio is an ArrayBuffer
from sixtydb import SixtyDBClient
client = SixtyDBClient('your-api-key')
audio = client.text_to_speech(
text='Hello, world! This is a test of the text to speech API.',
voice_id='default-voice',
enhance=True,
speed=1.0
)
# Save to file
with open('output.mp3', '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
ID of the voice to use (default: system default voice)
string
Alternative way to specify voice name
boolean
default:"true"
Enable audio enhancement for better quality
number
default:"1.0"
Speech speed multiplier (0.5 to 2.0)
number
default:"1.0"
Voice pitch multiplier (0.5 to 2.0)
string
default:"mp3"
Audio output format: mp3, wav, ogg, flac
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, world! This is a test of the text to speech API.",
"voice_id": "default-voice",
"enhance": true,
"speed": 1.0
}'
import { SixtyDBClient } from "60db";
const client = new SixtyDBClient("your-api-key");
const audio = await client.textToSpeech({
text: "Hello, world! This is a test of the text to speech API.",
voice_id: "default-voice",
enhance: true,
speed: 1.0,
});
// audio is an ArrayBuffer
from sixtydb import SixtyDBClient
client = SixtyDBClient('your-api-key')
audio = client.text_to_speech(
text='Hello, world! This is a test of the text to speech API.',
voice_id='default-voice',
enhance=True,
speed=1.0
)
# Save to file
with open('output.mp3', '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"
}