Theme
Getting started
Send your first VoiceLab request with a server-side API key.
Use the VoiceLab API
Create an API key
Create a key in the VoiceLab app, copy it once, and store it as a managed secret.
dotenvVOICELAB_API_KEY=vlk_your_secretSend it in the authorization header:
httpAuthorization: Bearer vlk_your_secretNever put a long-lived key in frontend code, a mobile app, logs, or a URL. See Authentication and API keys for permissions and rotation.
Choose a voice
Fetch the current language and voice catalogs. Do not hardcode them.
bashcurl -fS 'https://api.voicelab.uz/v1/tts/languages' \ -H "Authorization: Bearer $VOICELAB_API_KEY" curl -fS 'https://api.voicelab.uz/v1/voices?language=en' \ -H "Authorization: Bearer $VOICELAB_API_KEY"Use a returned
voice_...ID in the next request.Generate speech
bashcurl -fS 'https://api.voicelab.uz/v1/tts' \ -H "Authorization: Bearer $VOICELAB_API_KEY" \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: getting-started-0001' \ -d '{ "text": "Hello from VoiceLab.", "language": "en", "voice_id": "voice_01J9NEUTRAL0000000000000001", "speed": 1 }' \ -o hello.wav200 OKreturns mono, 16-bit PCM WAV audio at 24 kHz. Retry a timeout with the same idempotency key and body.Transcribe audio
bashcurl -fS 'https://api.voicelab.uz/v1/stt' \ -H "Authorization: Bearer $VOICELAB_API_KEY" \ -H 'Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000' \ -F 'audio=@meeting.mp3;type=audio/mpeg' \ -F 'language=en' \ -F 'include_speakers=false'Audio from 0.5 to 30 seconds and up to 10 MiB uses the synchronous endpoint. See the STT reference for long audio.