Developer Portal

API Reference

Integration-ready endpoints for high-performance Namibian language translation. Built for speed, scale, and accuracy.

01.Authentication

Our API supports two methods of authentication. Use API Keys for server-to-server communication and Bearer tokens for client-side user sessions.

Method A

API Key (Recommended)

Use the X-API-Key header to authenticate requests from your backend services.

X-API-Key: YOUR_SECRET_KEY
Method B

Bearer Token

Use the standard Authorization header for authenticated user portal calls.

Authorization: Bearer <JWT_TOKEN>

02.The "UI Mirroring" Pattern

Stop flattening your data. Our API respects your UI tree.

Unlike legacy translation APIs that require you to send flat arrays of strings, translate processes entire nested objects. The engine recursively traverses your payload, translates every { "og": "..." } node, and returns the exact same structure back.

Recursive Engine v2.0
// Input: Send your actual UI state
{ "payload": { "dashboard": { "title": { "og": "Your Revenue" }, "stats": { "label": { "og": "Active Users" } } } } }
// Output: Receive the mirrored localization tree
{ "payload": { "dashboard": { "title": { "hz": "Oitongwa joyoye", "af": "Jou Inkomste" }, "stats": { "label": { "hz": "Aalongi ya longa", "af": "Aktiewe Gebruikers" } } } } }

03.Quick Start

Integration with any stack is trivial. Choose your language and start translating.

const response = await fetch('https://api.translate.nkngo.com/translate', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    requestType: 'web_app',
    project: 'my_project',
    targetLanguages: ['hz', 'af'],
    payload: {
      header: {
        title: { og: 'Professional Translation Engine' }
      }
    }
  })
});

const data = await response.json();
console.log(data.payload.header.title.hz); // Wa lalapo...

04.Errors & Limits

Standard HTTP response codes for clear debugging.

CodeMessageDescription
400Bad RequestMalformed JSON or missing "payload" key.
401UnauthorizedInvalid API Key or expired Bearer token.
429Limit ReachedYour current API plan quota has been exceeded.
500Server ErrorTranslation engine cold-start or GPU timeout.