Tibetan-Chinese Neural Machine Translation API
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Required | Text to be translated |
| direction | string | Optional | Translation direction: tc (Tibetan→Chinese) or ct (Chinese→Tibetan)Default: tc |
curl -X POST https://your-domain.vercel.app/api/translate \
-H "Content-Type: application/json" \
-d '{
"text": "བཀྲ་ཤིས་བདེ་ལེགས།",
"direction": "tc"
}'
{
"success": true,
"source": "བཀྲ་ཤིས་བདེ་ལེགས།",
"translation": "扎西德勒",
"direction": "tc",
"directionName": "藏文→中文"
}
{
"success": false,
"error": "Error message"
}
// Request
{
"text": "བཀྲ་ཤིས་བདེ་ལེགས།",
"direction": "tc"
}
// Response
{
"success": true,
"translation": "扎西德勒"
}
// Request
{
"text": "你好",
"direction": "ct"
}
// Response
{
"success": true,
"translation": "ཁྱོད་བདེ་མོ།"
}
This API is deployed on Vercel's free tier with the following limits: