AgentLab Tibetan Translation

Tibetan-Chinese Neural Machine Translation API

API Endpoint

POST /api/translate

Request

Headers

Content-Type: application/json

Parameters

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

Example Request

curl -X POST https://your-domain.vercel.app/api/translate \
  -H "Content-Type: application/json" \
  -d '{
    "text": "བཀྲ་ཤིས་བདེ་ལེགས།",
    "direction": "tc"
  }'

Response

Success Response (200 OK)

{
  "success": true,
  "source": "བཀྲ་ཤིས་བདེ་ལེགས།",
  "translation": "扎西德勒",
  "direction": "tc",
  "directionName": "藏文→中文"
}

Error Response (4xx/5xx)

{
  "success": false,
  "error": "Error message"
}

Examples

Tibetan to Chinese

// Request
{
  "text": "བཀྲ་ཤིས་བདེ་ལེགས།",
  "direction": "tc"
}

// Response
{
  "success": true,
  "translation": "扎西德勒"
}

Chinese to Tibetan

// Request
{
  "text": "你好",
  "direction": "ct"
}

// Response
{
  "success": true,
  "translation": "ཁྱོད་བདེ་མོ།"
}
Note: This API is designed for educational and research purposes. Please use responsibly and avoid excessive requests.

Rate Limits

This API is deployed on Vercel's free tier with the following limits: