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. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 400 | Bad Request | |
| 500 | application/json | Internal Server Error |
| 404 | Not Found |
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": "English",
"guidance": ""
}'