Skip to content

Translation

Translate text between supported languages.

Endpoint: POST /translation/translate

Sent as multipart/form-data.

Field Type Required Description
sourceLanguage string yes Source language code (use auto for automatic detection)
targetLanguage string yes Target language code
textContent string one of textContent / fileContent Text to translate
fileContent file(s) one of textContent / fileContent CSV file(s) to translate instead of raw text
glossaryId string no Glossary ID to apply during translation
prompt string no Custom prompt to guide translation
flag boolean no Preserve source length when translating
ignoreCache boolean no Ignore previously cached translation results
fluency boolean no Also return a fluency evaluation for the translation (text-only, skipped for long text)

Success Response (200)

{
"status": "ok",
"timestamp": "2025-01-12T22:31:48.856Z",
"data": "Hallo, Welt!"
}

Success Response (200) — with fluency: true

{
"status": "ok",
"timestamp": "2025-01-12T22:31:48.856Z",
"data": "Hallo, Welt!",
"fluency": {
"value": 9.2,
"idiomatic": 9,
"collocational": 9,
"discourse": 9,
"pragmatic": 10,
"calque": 9,
"issue_type": "none",
"severity": null,
"problematic_phrase": null,
"suggested_fix": null,
"main_issue": null
}
}

Error Response (400)

{
"status": "error",
"timestamp": "2025-01-12T22:31:48.856Z",
"error": {
"message": "Invalid request parameters."
}
}
Terminal window
curl -X POST "https://platform.algebras.ai/api/v1/translation/translate" \
-H "X-Api-Key: your_api_key_here" \
-F "sourceLanguage=auto" \
-F "targetLanguage=de" \
-F "textContent=Hello, World!"