Theme
Authentication
VoiceLab server integrations authenticate with an API key.
REST / HTTP
Send this header on every request:
http
X-Api-Key: <your_api_key>Example:
bash
curl 'https://api.voicelab.uz/api/v1/tts/get/?page=1&limit=10' \
-H "X-Api-Key: $AISHA_API_KEY"SDK / CLI environment variable:
bash
export AISHA_API_KEY=your_api_keyThe aisha-ai package reads this variable automatically.
Realtime WebSocket
Pass the key as a query token:
txt
wss://api.voicelab.uz/api/v1/tts/realtime?token=<api_key>
wss://api.voicelab.uz/api/v1/stt/realtime?format=webm&token=<api_key>Browsers cannot set custom WebSocket headers reliably, so realtime auth uses the query string. Avoid logging full URLs that contain tokens.
gRPC
Metadata:
txt
x-api-key: <api_key>Host: api.voicelab.uz:443 (TLS).
Where to get a key
- Sign in at voicelab.uz/app.
- Create a key under API keys.
- Store the secret immediately — the full value is not shown again.
Security practices
- Keep keys on the server only; never ship them in a frontend bundle.
- Load
AISHA_API_KEYfrom.envor a secret store; do not commit it. - Rotate or revoke compromised keys in the VoiceLab app immediately.
- Use separate keys for production and staging.
- Prefer short-lived or limited keys for public demos.
Common errors
| Status | Meaning |
|---|---|
401 / 403 | Missing, invalid, or unauthorized key |
402 | Insufficient balance |
400 | Invalid parameters |
Typical error body:
json
{
"detail": "...",
"error_key": "invalid_api_key_format"
}Task status endpoint
GET /task-status/{task_id}/?instance_id={id} normally expects a user JWT (Bearer), not an API key. With an API key, poll async STT via GET /api/v2/stt/get/{id}/.
Next: Developer workflow · API overview