API reference
This section provides detailed API reference documentation for Bakbak Text-to-Speech API and Bakbak Speech-to-Text (STT) API.
All endpoints use HTTPS. HTTP is not supported. API keys that call the API over HTTP may be subject to automatic rotation.
API Overview
Bakbak TTS API
The Bakbak Text-to-Speech API provides endpoints for converting text into high-quality speech audio. It supports multiple Indian languages and various audio formats.
Base URL: https://hub.getraya.app/v1
Authentication: API key via X-API-Key header
Available Endpoints:
GET /v1/voices- List all available voicesPOST /v1/text-to-speech- Generate speech (non-streaming)POST /v1/text-to-speech/stream- Generate speech (streaming)
Bakbak STT API
The Bakbak Speech-to-Text (STT) API provides endpoints for transcribing WAV audio into text. It supports both HTTPS multipart transcription and WebSocket transcription.
Base URL: https://hub.getraya.app
Authentication: API key via X-API-Key header
Available Endpoints:
POST /transcribe- Transcribe audio file (multipart/form-data)- WebSocket
wss://hub.getraya.app/transcribe- Transcribe base64 audio payloads (one message per payload) - Interactive WSS playground: available under API Reference → Speech to Text (AsyncAPI)
Authentication
All APIs require authentication using an API key. Include the API key in the request headers:
Bakbak TTS API
Bakbak STT API
Obtaining API Keys
To obtain your API key for any of these APIs, please contact your administrator.
Request and Response Formats
Content Types
- Request:
application/jsonfor most endpoints - Request:
multipart/form-dataforPOST /transcribe - Response:
application/jsonfor data endpoints, binary audio for TTS endpoints
Error Responses
Both APIs return errors in a consistent format:
Common HTTP status codes:
200- Success400- Bad Request (validation error)401- Unauthorized (invalid or missing API key)404- Not Found429- Rate Limit Exceeded500- Internal Server Error
Rate Limiting
Bakbak TTS API
Rate limits vary by endpoint. Check individual endpoint documentation for specific limits.
When rate limited, you’ll receive a 429 status code with details about when to retry.
Best Practices
- Store API keys securely - Never commit API keys to version control
- Handle errors gracefully - Always check response status codes
- Use appropriate endpoints - Use streaming for real-time applications, non-streaming for batch processing
- Respect rate limits - Implement exponential backoff for retries
- Validate input - Check required fields and formats before making requests
Code Examples
Bakbak TTS - Generate Speech
Bakbak STT - Transcribe Audio (HTTPS)
SDKs and Libraries
Official SDKs are available for Bakbak TTS: the Python SDK and the JavaScript SDK. The REST APIs are also straightforward to use with any HTTP client library. Popular options include:
- Python:
requestslibrary - JavaScript/Node.js:
axiosorfetch - cURL: Command-line tool
- Postman: For testing and exploration
Support and Resources
- Documentation: This site
- Support Email: support@litwizlabs.ai
- Dashboard: https://bakbak.getraya.app
- Bakbak Studio: https://bakbak.getraya.app
Next Steps
- Explore the TTS API endpoints for text-to-speech functionality
- Explore the STT API endpoints for speech-to-text transcription
- Review the request/response schemas for each endpoint
- Try the examples in your preferred programming language

