Loading...
Loading...
Loading...
We use essential storage to operate Lexel Translate. With your permission, we also use analytics, advertising, and marketing technologies. Read our Cookie Policy.
Loading...
Translate ordered items synchronously with one shared language pair and one shared configuration scope across the entire batch.
/api/v1/translate/batch/sharedShared-config synchronous batch endpoint.
Request example
/api/v1/translate/batch/sharedcurl -X POST "https://translate.lexel.ai/api/v1/translate/batch/shared" \-H "Authorization: Bearer lxl_your_api_key" \-H "Content-Type: application/json" \-H "Idempotency-Key: batch-shared-demo-001" \-d '{"request_id": "req_batch_shared_demo_001","src": "en-Latn","tgt": "fr-Latn","glossary_id": "gls_support_terms","do_not_translate": ["Lexel Translate"],"input": {"items": [{"id": "item_1","txt": "Open a support ticket."},{"id": "item_2","txt": "Contact our support team."}]}}'
Response example
{"ok": true,"request_id": "req_batch_shared_demo_001","operation": "translate","output": {"kind": "batch","batch": [{"id": "item_1","ok": true,"translation": "Ouvrez un ticket d'assistance."},{"id": "item_2","ok": true,"translation": "Contactez notre équipe d'assistance."}]},"usage": {"input_characters": 47,"output_characters": 69},"warnings": [],"summary": {"total_items": 2,"successful_items": 2,"failed_items": 0}}
| Field | Type | Required | Description |
|---|---|---|---|
| request_id | string | Yes | Caller-provided request trace ID. |
| src | language tag | "" | Yes | Shared source language for the whole batch, or empty string for auto-detect. |
| tgt | language tag | Yes | Shared target language for the whole batch. |
| content_mode | auto | plain | markdown | html | json | xml | yaml | csv | No | Shared content mode for the batch. |
| split_input | 0 | 1 | 2 | No | 0 off, 1 balanced (default), 2 aggressive. Splitting can reduce latency with generally minimal impact on translation quality. |
| ps_context | string | No | Shared preceding-sentence context for the batch. |
| preserve_placeholders | boolean | No | Shared placeholder detection flag for the batch. |
| glossary_id | string | No | Shared stored glossary selection. |
| glossary_group_ids | string[] | No | Shared enabled glossary groups. |
| glossary_item_ids | string[] | No | Shared enabled glossary items. |
| do_not_translate | string[] | No | Shared protected terms. |
| input.items | array | Yes | Ordered batch items with id, txt, and optional ps_context. Per-item context overrides the root context. |
| input.items[].id | string | Yes | Caller-provided item ID returned with the result item. |
| input.items[].txt | string | Yes | Text to translate. |
| Field | Type | Required | Description |
|---|---|---|---|
| output.kind | "batch" | Yes | Batch output discriminator. |
| output.batch[] | array | Yes | Ordered per-item results. |
| output.batch[].ok | boolean | Yes | Whether the item translated successfully. |
| output.batch[].translation | string | No | Translated text when ok is true. |
| output.batch[].error | string | No | Item-level error message when ok is false. |
| summary.total_items | number | Yes | Total submitted items. |
| summary.successful_items | number | Yes | Number of successful item translations. |
| summary.failed_items | number | Yes | Number of failed item translations. |
/api/v1/translate/batch instead.