API Reference
Speech To Text · WebSocket
WSS
wss://stream.shabd.tech/v1/speech-to-textConnection headers
x-api-keystringrequiredAPI key for authentication.
Message flow
- Outgoing Message (↑): The client sends metadata first then sends audio data in bytes.
- Incoming Message (↓): The server responds json with requestId, status, transcript, language, chunk, completed, mode.
Send Metadata (↑):
{ "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "language": "tamil", "sampleRate": 16000, "projectId": "<your-project-id-here>"}Send Audio Data (↑):
Raw PCM 16-bit Audio Data (in Bytes) Initial messageapplication/json
requestIdstringrequiredUnique identifier for the request
languagestringrequiredLanguage of the speech, or "auto" to detect it
sampleRatenumber or nulloptionalSample Rate of the speech
- Default:
16000
projectIdstring or nulloptionalAn optional ID representing the project.
Server messages
The server streams transcribed text along with status and progress updates.
Receive Transcription (↓):
{ "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "status": true, "transcript": "வணக்கம் இனிய நாள்!", "chunk": 1, "completed": false, "mode": "stt"}When the transcription is complete:
{ "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "status": true, "transcript": "", "chunk": 2, "completed": true, "mode": "stt"}Messages
Example response
{ "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "status": true, "transcript": "வணக்கம் இனிய நாள்!", "chunk": 1, "completed": false, "mode": "stt"} { "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "status": true, "transcript": "", "chunk": 2, "completed": true, "mode": "stt"}