API Reference
Text Translation · WebSocket
WSS
wss://stream.shabd.tech/v1/text-translateConnection headers
x-api-keystringrequiredAPI key for authentication.
Message flow
- Outgoing Message (↑): The client sends a JSON object with the necessary parameters for text translation.
- Incoming Message (↓): The server responds json with requestId, status, translation, chunk, completed, mode.
Send Message (↑):
{ "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "text": "नमस्ते, आपका दिन शुभ हो!", "sourceLanguage": "hindi", "targetLanguage": "tamil"}Initial messageapplication/json
requestIdstringrequiredUnique identifier for the request
textstringrequiredText content to be translated
sourceLanguagestringrequiredSource Language of the text
targetLanguagestringrequiredTarget language of the text
Server messages
The server streams translated text along with status and progress updates.
Receive Translation (↓):
{ "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "status": true, "translation": "வணக்கம் இனிய நாள்!", "chunk": 1, "completed": false, "mode": "ttt"}When the translation is complete:
{ "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "status": true, "translation": "", "chunk": 2, "completed": true, "mode": "ttt"}Messages
Example response
{ "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "status": true, "translation": "வணக்கம் இனிய நாள்!", "chunk": 1, "completed": false, "mode": "ttt"} { "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "status": true, "translation": "", "chunk": 2, "completed": true, "mode": "ttt"}