Async Translate
POST
/async_translate
const url = 'https://example.com/async_translate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"source_lang":"example","target_lang":"example","registered_model_name":"example","variant":"example","text":"example","generation_params":{},"document_type":"example","chunking_strategy":"sentence","max_chunk_tokens":1,"overlap_tokens":20,"preserve_context":true,"experiment_name":"example","client_request_id":"example","disable_prompt_formatting":false,"use_pivot":false,"translation_job_uuid":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/async_translate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "source_lang": "example", "target_lang": "example", "registered_model_name": "example", "variant": "example", "text": "example", "generation_params": {}, "document_type": "example", "chunking_strategy": "sentence", "max_chunk_tokens": 1, "overlap_tokens": 20, "preserve_context": true, "experiment_name": "example", "client_request_id": "example", "disable_prompt_formatting": false, "use_pivot": false, "translation_job_uuid": "example" }'Submit a single translation to the Celery queue and return immediately with a task_id. Warmup polling and translation happen in the worker — no hard timeout. Poll GET /translation/{task_id} for progress and results.
Idempotency: if client_request_id is provided, duplicate submissions return the existing task_id instead of spawning a second Celery task.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
FlexibleTranslationRequest
object
source_lang
required
Source Lang
string
target_lang
required
Target Lang
string
registered_model_name
required
Registered Model Name
string
text
required
Text
string
Responses
Section titled “Responses”Successful Response
Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}