Vulavula Logo
Translate

Translate

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

# Endpoint URL
import requests
url = 'https://vulavula-services.lelapa.ai/api/v1/translate/process'

# Headers
headers = {
    'Content-Type': 'application/json',
    'X-CLIENT-TOKEN': '<INSERT_TOKEN>' # Replace '<INSERT_TOKEN>' with your actual client token
}

# Request body
data = {
  "input_text": "Lo musho ubhalwe ngesiZulu.",
  "source_lang": "zul_Latn",
  "target_lang": "eng_Latn"
}

# Sending POST request
response = requests.post(url, headers=headers, json=data)

# Printing response
print(response.json())
python

RESPONSES

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

RESPONSE BODY PARAMS

Object
translation array required.
An array containing the translated text.
translated_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.