Translate text into local African languages. 16 languages. Neural MT. No dictionary lookups.
curl -X POST https://api.thexi.dev/v1/translate \
-H "Authorization: Bearer tj_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hello, how are you?", "target_lang": "sw"}'
Every request requires an API key. Include it in one of:
| Method | Example |
|---|---|
| Header | Authorization: Bearer tj_live_xxx |
| Header | X-Api-Key: tj_live_xxx |
| Query | ?key=tj_live_xxx (for script embeds) |
Get your API key at thexi.dev/contact or email api@thexi.dev.
Translate text into a target language.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Source text (English) |
target_lang | string | No | Target language code (default: sw) |
source_lang | string | No | Source language code (default: en) |
// Response
{
"translation": "Habari, unaendeleaje?",
"detected_lang": "en",
"target_lang": "sw",
"target_lang_name": "Swahili (Kiswahili)",
"model": "nllb-200-ct2",
"quality": "high",
"cost_usd": 0.0,
"usage": {
"chars_used_today": 1240,
"chars_remaining": 8760,
"requests_today": 12
}
}
Translate multiple strings in one call — ideal for website i18n.
// Request
{
"target_lang": "ki",
"strings": {
"nav.home": "Home",
"nav.about": "About us",
"cta.signup": "Sign up now"
}
}
// Response
{
"translations": {
"nav.home": "Mucii",
"nav.about": "Niithui",
"cta.signup": "Iyandikithie na hari"
},
"quality": "high",
"model": "nllb-200"
}
List all supported languages with quality tiers.
Check your usage and remaining quota.
Add mother-tongue translation to any website with one line:
<script src="https://api.thexi.dev/v1/snippet.js?key=tj_live_xxx"
data-target="en|sw|ki|luo"></script>
Every response includes rate limit headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Max requests per day |
X-RateLimit-Remaining | Requests remaining today |
X-RateLimit-Reset | When limits reset (midnight UTC) |
X-Usage-Chars | Total characters translated today |
| Code | Language | Quality |
|---|---|---|
sw | Swahili (Kiswahili) | High |
ki | Kikuyu (Gikuyu) | High |
luo | Luo (Dholuo) | High |
kam | Kamba (Kikamba) | High |
so | Somali | High |
am | Amharic | High |
yo | Yoruba | High |
zu | Zulu (isiZulu) | High |
xh | Xhosa (isiXhosa) | High |
sn | Shona | High |
rw | Kinyarwanda | High |
lg | Luganda | High |
luy | Luhya (Oluluhya) | Low |
kln | Kalenjin | Low |
mer | Meru (Kimeru) | Low |
mas | Maasai (Maa) | Low |
All errors return JSON with an error field:
{"error": "rate_limit_exceeded", "message": "Daily request limit (100) exceeded.", "tier": "free"}