Documentation
Everything you need to integrate Vagary Voice into your applications
Getting Started
API Reference
Guides
Code Examples
Get started quickly with these examples
Quick Start - Speech-to-Text
pythonfrom vagary_voice import VagaryVoice
# Initialize client
client = VagaryVoice(api_key="your_api_key")
# Transcribe audio
result = client.transcribe(
audio_file="audio.mp3",
language="en-US",
enable_diarization=True
)
print(result.transcript)
print(result.speakers)Quick Start - Text-to-Speech
javascriptimport { VagaryVoice } from '@vagary/voice-sdk';
// Initialize client
const client = new VagaryVoice({
apiKey: process.env.VAGARY_API_KEY
});
// Synthesize speech
const audio = await client.synthesize({
text: 'Hello from Vagary Voice!',
voice: 'en-US-Neural-Female',
emotion: 'friendly'
});
// Save or stream the audio
await audio.save('output.mp3');Real-time Streaming
javascriptconst stream = client.streamTranscribe({
language: 'en-US',
interimResults: true
});
// Handle transcripts
stream.on('transcript', (data) => {
if (data.isFinal) {
console.log('Final:', data.text);
} else {
console.log('Interim:', data.text);
}
});
// Send audio data
microphone.on('data', (chunk) => {
stream.write(chunk);
});API Endpoints
Quick reference for all API endpoints
POST
/v1/speech-to-text/transcribeTranscribe audio file to text
POST
/v1/text-to-speech/synthesizeConvert text to natural speech
WS
/v1/stream/transcribeReal-time streaming transcription
GET
/v1/voicesList available voices