Translation
Translates the input text, PDF, HTML, EML, MBOX, MS Office document or image.#
/lmkit/v1/translateTranslates the provided content using the specified or default translation model. You can optionally specify the target language (and source language if supported). Returns the translated text. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/ for status and results.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
model | string | The ID of the model used for text translation. If not specified, the default model will be used. |
inputrequired | string | The input data for translation. This can either be a plain text string or a base64-encoded file containing text, based on the specified input format. |
input_format | The format of the input data. Acceptable values are 'PlainText' or 'Base64EncodedFile'. In the case of 'Base64EncodedFile', the supported formats are PDF, DOCX, PPTX, XLSX, EML, and MBOX. Defaults to 'PlainText' if not specified. | |
languagerequired | The target language for translation. | |
guidance | string | Optional free-text guidance steering how the content is translated (terminology, proper-name handling, register and tone, e.g. 'keep product names untranslated; use a formal register'). Applied to every chunk so terminology stays consistent across long inputs. When empty, the default translation behavior is used. |
text_format | The syntax of a plain-text input: 'Auto' (default) detects Markdown from the text itself, 'Markdown' and 'PlainText' state it. A Markdown input is split at its block boundaries (a heading opens a chunk; a table, a list or a code block is never cut) and the model is asked to keep every marker where it stands and translate only the words. A file input's extracted text is read the same way. | |
max_pages | object (int32) | Read only the first N pages of the file; the pages after them are never rendered, OCR'd or read. Omit to read every page the server's limits allow. A value above the server's limit does not raise it. The response lists the cut in limits_applied. |
on_limit | one of object · |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 400 | Bad Request | |
| 404 | Not Found | |
| 500 | application/json | Internal Server Error |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/translate" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "string",
"input": "string",
"input_format": "PlainText",
"language": "openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464",
"guidance": "",
"text_format": "Auto"
}'