REST API for machine translation · metered per character

Translation as an HTTP endpoint

POST your strings and get them back in any of 36 languages. Metered per character, run from Frankfurt, and shaped to sit next to the rest of your backend rather than on top of it.

Get a free key $ curl -X POST https://api.langapi.xyz/v1/translate

36
languages you can send
€15.00
for a million characters
38
target variants

Paste, pick a language, read

$ curl -X POST https://api.langapi.xyz/v1/translate \
  -H "Authorization: Bearer la_live_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"text":["Thanks for your order"],"target_lang":"FR"}'

{
  "translations": [
    { "detected_source_language": "EN",
      "text": "Merci pour votre commande" }
  ],
  "request_id": "01J8ZC4M9XK3P7QW2NRT5V6YAB",
  "characters": 21
}
0 / 300 characters

Your translation will show up here.

Works without an account

01

Metered like bandwidth

Characters in, invoice out. No seats to license, no annual contract, no minimum. Top up a prepaid balance or take a monthly plan with volume included, and change your mind whenever you like.

02

Built where the GDPR is home turf

Application, database and queue run in Frankfurt. Usage records hold counts, never content. The output cache is optional per team, and every sub-processor is named in the data processing agreement.

03

Speaks the request format you already use

Request and response follow the widely used v2 translation convention. For most existing client code that means a new base URL, a new key, and nothing else.

Your first request, in the language you write

Pass up to 50 strings and a target language code. Source detection, formality and glossaries are opt-in parameters, not extra endpoints.

curl

curl -X POST https://api.langapi.xyz/v1/translate \
  -H "Authorization: Bearer la_live_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"text":["Thanks for your order"],"target_lang":"DE"}'

PHP

$ch = curl_init('https://api.langapi.xyz/v1/translate');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer la_live_xxxxxxxx', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode(['text' => ['Thanks for your order'], 'target_lang' => 'DE']),
]);
$response = json_decode(curl_exec($ch), true);
echo $response['translations'][0]['text'];

JavaScript

const response = await fetch('https://api.langapi.xyz/v1/translate', {
  method: 'POST',
  headers: { Authorization: 'Bearer la_live_xxxxxxxx', 'Content-Type': 'application/json' },
  body: JSON.stringify({ text: ['Thanks for your order'], target_lang: 'DE' }),
});
const { translations } = await response.json();
console.log(translations[0].text);

Python

import requests

response = requests.post(
    "https://api.langapi.xyz/v1/translate",
    headers={"Authorization": "Bearer la_live_xxxxxxxx"},
    json={"text": ["Thanks for your order"], "target_lang": "DE"},
    timeout=30,
)
print(response.json()["translations"][0]["text"])

Go

body, _ := json.Marshal(map[string]any{
    "text":        []string{"Thanks for your order"},
    "target_lang": "DE",
})
req, _ := http.NewRequest("POST", "https://api.langapi.xyz/v1/translate", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer la_live_xxxxxxxx")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)

Prices on the page, not in a sales call

Prepaid usage is €15.00 per million characters. The Starter plan is €19.00 a month and includes 2,000,000 characters; Business is €99.00 a month.

Compare the plans

faq

Questions we get before the first key

What does the translation quality look like?

A large language model does the translating, steered by a prompt written for translation, your glossary terms and the formality you ask for. On European pairs it holds up against the established engines. The fastest way to judge it is the box above: paste your own text, no account required.

Where does my text go?

To Frankfurt first: the application, database and queue run in Germany. The engine behind it may process text in the EU or the US, depending on the configuration named in the data processing agreement, and any transfer is covered by the EU standard contractual clauses.

Does markup survive the round trip?

Yes. With tag_handling set to html or xml, tags and attributes stay untouched and only the text between them is translated. Whole documents such as DOCX or PDF are planned but not part of the current release.

What does switching from another provider involve?

Usually a new base URL, https://api.langapi.xyz/v1, and a new key. The request format follows the common v2 convention and the DeepL-Auth-Key header is accepted too, so most existing client libraries keep working as they are.

How much can I send at once?

Fifty strings per request, between 50,000 and 200,000 characters per request depending on the plan, and 10 to 100 requests per second. The rate-limit headers on every response tell you where you stand.