🌍 REST API — v1.0

LangMaster Translation API

Fine-tuned NLLB-200 — Bidirectional translation for Igbo, Yoruba & Hausa

Overview

This API provides neural machine translation between English and three Nigerian languages — Igbo, Yoruba, and Hausa — using fine-tuned Meta NLLB-200 models trained on parallel corpora and bilingual dictionaries. All requests require an API key passed in the X-API-Key header.


Base URL: https://ai.thelangmaster.com

Authentication

Every request to /translate must include your API key in the request header:

X-API-Key: your-api-key-here

Contact the administrator to obtain an API key. Keys are rate-limited to 30 requests per minute.

POST Translate

https://ai.thelangmaster.com/translate

Translates text between English and a supported Nigerian language.

HeaderValueRequired
Content-Typeapplication/jsonRequired
X-API-KeyYour API keyRequired
FieldTypeRequiredDescription
textstringRequiredText to translate. Max 2000 characters.
langstringRequiredLanguage direction code (see table below).
# Igbo → English
curl -X POST https://ai.thelangmaster.com/translate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key-here" \
  -d '{"text": "Ọ dị mma", "lang": "ig"}'
{
  "translation": "It is good",
  "lang": "ig"
}

Supported Languages

Pass one of these codes as the lang field in your request:

ig→ Igbo → English
en-ig→ English → Igbo
yo→ Yoruba → English
en-yo→ English → Yoruba
ha→ Hausa → English
en-ha→ English → Hausa

More Examples

curl -X POST https://ai.thelangmaster.com/translate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key-here" \
  -d '{"text": "Good morning", "lang": "en-yo"}'
curl -X POST https://ai.thelangmaster.com/translate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key-here" \
  -d '{"text": "Ina son kofi", "lang": "ha"}'
const res = await fetch("https://ai.thelangmaster.com/translate", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": "your-api-key-here"
  },
  body: JSON.stringify({ text: "Ọ dị mma", lang: "ig" })
});
const data = await res.json();
console.log(data.translation);

GET Health Check

https://ai.thelangmaster.com/health

Returns the current API status and which model is loaded in memory. No API key required.

curl https://ai.thelangmaster.com/health
{
  "status": "ok",
  "loaded_model": "ig"
}

Error Codes

CodeMeaning
401Missing X-API-Key header
403Invalid API key
413Request body exceeds 10KB
422Validation error — empty text, invalid lang, or text over 2000 characters
429Rate limit exceeded — 30 requests per minute per key

Limits & Notes

LimitValue
Max text length2000 characters per request
Rate limit30 requests / minute per API key
Max request body10 KB
Response time2 – 8 seconds depending on text length and language switch

Only one language model is held in memory at a time. Switching languages (e.g. from Igbo to Yoruba) triggers a model swap which adds ~10–20 seconds on the first request for that language.