Skip to content

Async Translate

POST
/async_translate
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.

Media typeapplication/json
FlexibleTranslationRequest
object
source_lang
required
Source Lang
string
>= 1 characters <= 20 characters
target_lang
required
Target Lang
string
>= 1 characters <= 20 characters
registered_model_name
required
Registered Model Name
string
>= 1 characters <= 200 characters
variant
Any of:
string
<= 64 characters
text
required
Text
string
>= 1 characters
generation_params
Any of:
object
key
additional properties
any
document_type
Any of:
string
chunking_strategy
Any of:
string
/^(sentence|paragraph|token|sliding)$/
max_chunk_tokens
Any of:
integer
>= 50 <= 8192
overlap_tokens
Any of:
integer
<= 1000
preserve_context
Any of:
boolean
experiment_name
Any of:
string
<= 200 characters
client_request_id
Any of:
string
disable_prompt_formatting
Any of:
boolean
use_pivot
Any of:
boolean
translation_job_uuid
Any of:
string

Successful Response

Media typeapplication/json
TranslationSubmission
object
task_id
required
Task Id

Celery task ID for tracking the translation job

string
run_id
Any of:
string
status
Status

Initial status of the task

string
default: queued
Example
{
"status": "queued"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
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": {}
}
]
}