Skip to main content

Documentation Index

Fetch the complete documentation index at: https://sunbirdai.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The Sunbird AI API provides high-quality machine translation for Ugandan languages using the NLLB (No Language Left Behind) model.

Overview

Our translation service supports bidirectional translation between English and 5 major Ugandan languages. It is designed to handle general-purpose text with high accuracy.

Supported Languages

We currently support translation between English and the following languages:
LanguageCodeDirection
AcholiachEnglish ↔ Acholi
AtesoteoEnglish ↔ Ateso
LugandalugEnglish ↔ Luganda
LugbaralggEnglish ↔ Lugbara
RunyankolenynEnglish ↔ Runyankole
Direct translation between local languages (e.g., Acholi to Luganda) is not currently supported. You must translate via English (Acholi → English → Luganda).

How to Translate

Use the /tasks/nllb_translate endpoint.

Parameters

ParameterTypeRequiredDescription
textstringYesThe text to be translated.
source_languagestringYesThe language code of the input text.
target_languagestringYesThe language code for the output.

Example Request

Translating “Good morning” from English to Runyankole.
import requests

url = "https://api.sunbird.ai/tasks/nllb_translate"
payload = {
    "text": "Good morning",
    "source_language": "eng",
    "target_language": "nyn"
}
headers = {
    "Authorization": "Bearer <YOUR_TOKEN>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())

Response

{
  "output": {
    "translated_text": "Oraire ota"
  }
}

Best Practices

  • Sentence Length: Keep sentences reasonably short for better accuracy.
  • Context: The model works best with complete sentences rather than isolated words.
  • Punctuation: Proper punctuation helps the model understand the structure of the text.