Translation API

Translate content across languages with one unified endpoint.

Luntrex routes translation requests to providers like DeepL while applying your policies for latency, cost, and tone. Follow the same dark-glass visual language to discover authentication, payloads, and supported locales.

Translate API

Send multilingual experiences without managing multiple vendors. The translation endpoint normalizes responses, logs token usage, and integrates with routing telemetry.

Base URL https://luntrex.com/api/v1

Overview

Use POST /translate to convert text between locales. Specify input content, source/target codes, tone, and preferred model. Luntrex enforces guardrails and returns normalized responses.

Request payload

Provide the text you want to translate. Omitting source triggers auto-detection. Formality controls tone when the provider supports it.

{
  "text": "Hello, how are you?",
  "target": "IT",
  "source": "EN",
  "formality": "less",
  "model": "deepl/deepl"
}

Authentication

Reuse the same bearer tokens across Luntrex APIs. Scope them to translation permissions to keep environment access clean.

Authorization header

Authorization: Bearer <YOUR_API_KEY>

Supported Models

Luntrex routes translation requests to providers like DeepL while applying your policies for latency, cost, and tone. Follow the same dark-glass visual language to discover authentication, payloads, and supported locales.

Model list

deepl/deepl

Examples

Call the translation endpoint from any language that can make HTTPS requests.

JavaScript (fetch)

const resp = await fetch('https://luntrex.com/api/v1/translate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <YOUR_API_KEY>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    text: 'Hello, how are you?',
    target: 'IT',
    source: 'EN',
    formality: 'less',
    model: 'deepl/deepl',
  }),
});
const data = await resp.json();
console.log(data.translation);

Python (requests)

import requests

r = requests.post(
  "https://luntrex.com/api/v1/translate",
  headers={
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json",
  },
  json={
    "text": "Hello, how are you?",
    "target": "IT",
    "source": "EN",
    "formality": "less",
    "model": "deepl/deepl",
  }
)
print(r.json()["translation"])

PHP (Laravel Http client)

use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
  'Authorization' => 'Bearer <YOUR_API_KEY>',
  'Content-Type'  => 'application/json',
])->post('https://luntrex.com/api/v1/translate', [
  'text'      => 'Hello, how are you?',
  'target'    => 'IT',
  'source'    => 'EN',
  'formality' => 'less',
  'model'     => 'deepl/deepl',
]);

echo $response->json()['translation'];

Postman / cURL

Validate your credentials with a quick cURL command or import a Postman collection.

cURL example

curl -X POST "https://luntrex.com/api/v1/translate" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello, how are you?",
    "target": "IT",
    "source": "EN",
    "formality": "less",
    "model": "deepl/deepl"
  }'

Errors

Inspect error details to improve resiliency. Luntrex propagates provider information while preserving a consistent payload format.

Example error payload

{
  "error": "Insufficient credits",
  "status": 403
}

Supported languages

Expand support from day one. Add more language codes in the dashboard or via API-based configuration. Below are the initial locales enabled in this workspace.

Available language codes

EN — English IT — Italian DE — German FR — French JA — Japanese
Back to top