Skip to main content

Vulavula Translate

Translation

POST https://vulavula-services.lelapa.ai/api/v1/translate/process.

The Translation endpoint takes the provided text and translates it from the source language to the target language. The maximum text length for each request is 256 words.

BODY PARAMS

input_text string required.
This parameter represents the text input that will be translated from one language to another. It is required for the endpoint to function properly. The input_text should be provided as a string and contains the text to be processed by the Translation model.

source_lang string required.
This parameter represents the source language of the text that will be translated. It is required for the endpoint to function properly. The source_lang should be provided as a string.

target_lang string required.
This parameter represents the target language to which the text will be translated. It is required for the endpoint to function properly. The target_lang should be provided as a string. HEADERS

X-CLIENT-TOKEN string required.
Represents the authentication token required for accessing the API. This header ensures that only authorized clients can make requests to the endpoint.

EXAMPLES

pdm add vulavula
from vulavula import VulavulaClient
client = VulavulaClient("<INSERT_TOKEN>")

translation_data = {
"input_text": "Lo musho ubhalwe ngesiZulu.",
"source_lang": "zul_Latn",
"target_lang": "eng_Latn"
}
translation_result = client.translate(translation_data)
print("Translation Result:", translation_result)

You can also translate to other languages by changing the source_lang and target_lang parameter:

  • Northern Sotho (nso_Latn)
  • Afrikaans (afr_Latn)
  • Southern Sotho (sot_Latn)
  • Swati (ssw_Latn)
  • Tsonga (tso_Latn)
  • Tswana (tsn_Latn)
  • Xhosa (xho_Latn)
  • Zulu (zul_Latn)
  • English (eng_Latn)
  • Swahili (swh_Latn)
  • Shona (sna_Latn)

RESPONSES

🟢 200 OK
The request was successful. Below is an example response body
{
"id": "deed7995-dcf4-4456-bd33-c92ca1d990ca",
"translation": [
{
"translation_text": "This sentence is written in Zulu."
}
]
}

RESPONSE BODY PARAMS

Object
translation array required.
An array containing the translated text.
translation_text string required.
Contains the translated text.
🔴 400 Bad Request
The request was malformed or contained invalid data
🟠 401 Unauthorized
The client token is missing or invalid.
🔴 500 Internal Server Error
An unexpected error occurred on the server.