API Reference
Text Translation · HTTP Stream
POST
https://api.shabd.tech/v1/text-translate/streamTranslates text, streamed as NDJSON — one ttt line per translation chunk, ending with a completed: true line.
Headers
x-api-keystringrequiredAPI Key for authentication
- Example:
<your-api-key>
Content-TypestringrequiredContent type of the request body
- Example:
application/json
x-request-idstringrequiredUnique request ID in UUID format
- Example:
550e8400-e29b-41d4-a716-446655440000
Request bodyapplication/json
textstringrequiredText to translate
- Example:
Language is a powerful tool that allows us to connect and share knowledge.
sourceLanguagestringrequiredLanguage of the input text
- Example:
english
targetLanguagestringrequiredLanguage to translate into
- Example:
tamil
stylestringoptionalTranslation style ("conversational" or "formal")
- Allowed:
conversationalformal- Default:
conversational
projectIdstringoptionalOptional project identifier
- Example:
<your-project-id-here>
Responses
NDJSON stream — one ttt JSON object per line, newline-separated.
On failure a single error line is sent:
{ "requestId": "a216e43a-9d81-444c-a9ae-3c1e400fcb02", "status": false, "completed": false, "message": "An unexpected error occurred. Please try again later." }Bodyapplication/x-ndjson
requestIdstringoptional- Example:
550e8400-e29b-41d4-a716-446655440000
modestringoptional- Example:
ttt
statusbooleanoptional- Example:
true
completedbooleanoptional- Example:
false
chunkintegeroptional- Example:
1
translationstringoptional- Example:
மொழி என்பது நம்மை இணைக்கும் ஒரு சக்திவாய்ந்த கருவி.
Example response
{ "requestId": "550e8400-e29b-41d4-a716-446655440000", "mode": "ttt", "status": true, "completed": false, "chunk": 1, "translation": "மொழி என்பது நம்மை இணைக்கும் ஒரு சக்திவாய்ந்த கருவி."}Bad Request
Bodyapplication/json
statusbooleanoptional- Example:
false
messagestringoptional- Example:
Invalid input parameters.
Example response
{ "status": false, "message": "Invalid input parameters."}Unauthorized Access
Bodyapplication/json
statusbooleanoptional- Example:
false
messagestringoptional- Example:
Unauthorized access.
Example response
{ "status": false, "message": "Unauthorized access."}Usage Limit Exceeded
Bodyapplication/json
statusbooleanoptional- Example:
false
messagestringoptional- Example:
Limit Exceeded
Example response
{ "status": false, "message": "Limit Exceeded"}Internal server error
Bodyapplication/json
statusbooleanoptional- Example:
false
messagestringoptional- Example:
An unexpected error occurred. Please try again later.
Example response
{ "status": false, "message": "An unexpected error occurred. Please try again later."}