Skip to content

Translation (Batch Mode)

Translate multiple texts in a single batch request.

Endpoint: POST /translation/translate-batch

{
"sourceLanguage": "en",
"targetLanguage": "de",
"texts": [
"Hello, World!",
"How are you?",
"Thank you very much"
]
}

Parameters:

  • sourceLanguage: Source language code (use “auto” for automatic detection)
  • targetLanguage: Target language code
  • texts: Array of strings to translate

Success Response (200)

{
"status": "ok",
"timestamp": "2025-01-12T22:31:48.856Z",
"data": [
"Hallo, Welt!",
"Wie geht es dir?",
"Vielen Dank"
]
}
Terminal window
curl -X POST "https://platform.algebras.ai/api/v1/translation/translate-batch" \
-H "X-Api-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"sourceLanguage": "en",
"targetLanguage": "de",
"texts": [
"Hello, World!",
"How are you?",
"Thank you very much"
]
}'

Start an asynchronous agentic translation task.

Endpoint: POST /translation/agentic-translate

{
"sourceLanguage": "en",
"targetLanguage": "de",
"text": "Hello, World!",
"options": {
"uiSafe": false,
"glossaryId": "glossary-123"
}
}

Parameters:

  • sourceLanguage: Source language code
  • targetLanguage: Target language code
  • text: Text to translate
  • options: Optional configuration object
    • uiSafe: Whether to ensure UI-safe translations (optional)
    • glossaryId: Glossary ID to use for translation (optional)

Success Response (200)

{
"status": "ok",
"timestamp": "2025-01-12T22:31:48.856Z",
"data": {
"id": "task-123456",
"status": "pending"
}
}
Terminal window
curl -X POST "https://platform.algebras.ai/api/v1/translation/agentic-translate" \
-H "X-Api-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"sourceLanguage": "en",
"targetLanguage": "de",
"text": "Hello, World!",
"options": {
"uiSafe": false,
"glossaryId": "glossary-123"
}
}'

Get the status of an agentic translation task by ID.

Endpoint: GET /translation/agentic-translate/{id}

  • id: Task ID returned from the agentic-translate endpoint

Success Response (200)

{
"status": "ok",
"timestamp": "2025-01-12T22:31:48.856Z",
"data": {
"id": "task-123456",
"status": "completed",
"result": "Hallo, Welt!",
"progress": 100
}
}
Terminal window
curl -X GET "https://platform.algebras.ai/api/v1/translation/agentic-translate/task-123456" \
-H "X-Api-Key: your_api_key_here"