Documentation Index
Fetch the complete documentation index at: https://docs.60db.ai/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Initialization
from sixtydb import SixtyDBClient
# Simple initialization
client = SixtyDBClient('your-api-key')
# With custom configuration
### Get all voices
voices = await client.getVoices();
### Get all lanuages
lanuages = await client.getLanguages();
### audio is an ArrayBuffer containing the audio data
Text-to-Speech
Basic TTS
audio = client.text_to_speech(
text='Hello, world!',
voice_id='default-voice',
enhance=True,
speed=1.0,
language='en-us'
)
# Save to file
with open('output.mp3', 'wb') as f:
f.write(audio)
Speech-to-Text
Transcribe Audio
with open('audio.mp3', 'rb') as audio_file:
result = client.speech_to_text(audio_file, language='en')
print(result['text'])
With Context Refinement
Supply a context string to enable server-side LLM polishing — proper nouns, filler removal, and punctuation are cleaned on the response text:
with open('audio.mp3', 'rb') as audio_file:
result = client.speech_to_text(
audio_file,
language='hi',
diarize=True,
context='Cricket coaching session. Players: Arjun Mehta, Ishaan Verma. Discussing batting technique.',
)
print(result['text'])
Omit context entirely to skip refinement. Note: this is the REST shape — the WebSocket streaming endpoint takes a {general, text, terms} object instead.
Get Supported Languages
languages = client.get_languages()
for lang in languages:
print(f"{lang['name']} ({lang['code']})")
Voice Management
List All Voices
voices = client.get_voices()
for voice in voices:
print(f"{voice['name']} ({voice['id']})")
Get Specific Voice
voice = client.get_voice('voice-id')
print(voice)
Create Custom Voice
files = [
open('sample1.mp3', 'rb'),
open('sample2.mp3', 'rb'),
open('sample3.mp3', 'rb')
]
new_voice = client.create_voice(
name='My Custom Voice',
files=files,
description='A custom voice for my brand'
)
print(f"Created voice: {new_voice['id']}")
# Close files
for f in files:
f.close()
Update Voice
client.update_voice(
voice_id='voice-id',
name='Updated Voice Name',
description='Updated description'
)
Delete Voice
client.delete_voice('voice-id')
Authentication
Sign Up
user = client.sign_up(
email='[email protected]',
password='secure-password',
name='John Doe'
)
Sign In
session = client.sign_in(
email='[email protected]',
password='secure-password'
)
print(f"Token: {session['token']}")
Get Profile
profile = client.get_profile()
print(profile)
Update Profile
client.update_profile(
name='Jane Doe',
company='Acme Inc'
)
Workspace Management
List Workspaces
workspaces = client.get_workspaces()
Create Workspace
workspace = client.create_workspace(
name='My Workspace',
description='Team workspace'
)
Billing
Get Available Plans
plans = client.get_plans()
for plan in plans:
print(f"{plan['name']}: ${plan['price']}/month")
Analytics
Get Usage Statistics
usage = client.get_usage()
print(f"Characters used: {usage['characters']}")
print(f"API calls: {usage['api_calls']}")
API Key Management
List API Keys
api_keys = client.get_api_keys()
Create API Key
new_key = client.create_api_key('Production Key')
print(f"New API key: {new_key['key']}")
Delete API Key
client.delete_api_key('key-id')
Webhooks
List Webhooks
webhooks = client.get_webhooks()
Create Webhook
webhook = client.create_webhook(
url='https://example.com/webhook',
events=['tts.completed', 'stt.completed']
)
Delete Webhook
client.delete_webhook('webhook-id')
Error Handling
from requests.exceptions import HTTPError
try:
audio = client.text_to_speech(
text='Hello, world!',
voice_id='invalid-voice'
)
except HTTPError as e:
print(f"HTTP Error: {e.response.status_code}")
print(f"Message: {e.response.json()['message']}")
except Exception as e:
print(f"Error: {str(e)}")
Type Hints
The SDK includes type hints for better IDE support:
from sixtydb import SixtyDBClient
from typing import Dict, List, Any
client: SixtyDBClient = SixtyDBClient('your-api-key')
voices: List[Dict[str, Any]] = client.get_voices()
Async Support
For async applications, you can use the SDK with asyncio:
import asyncio
from sixtydb import SixtyDBClient
async def main():
client = SixtyDBClient('your-api-key')
# Run in executor for async compatibility
loop = asyncio.get_event_loop()
audio = await loop.run_in_executor(
None,
client.text_to_speech,
'Hello, world!',
'default-voice'
)
with open('output.mp3', 'wb') as f:
f.write(audio)
asyncio.run(main())