Language Detection
Detects the language of the input text, PDF, HTML, EML, MBOX, MS Office document or image.#
/lmkit/v1/detect-languageAnalyzes the provided content to determine its language using the specified or default detection model. Optionally, you can restrict detection to a subset of languages. Returns the detected language as defined in the Language enumeration. 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 language detection. If not specified, the default model will be used. |
inputrequired | string | The input for language detection. When input_format is 'PlainText', provide raw text. When 'Base64EncodedFile', provide a base64-encoded file payload (supported: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the api/v1/files/upload endpoint. |
input_format | How the input is provided. Accepted values: 'PlainText', 'Base64EncodedFile', or 'FileIdentifier'. 'Base64EncodedFile' supports: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF. 'FileIdentifier' references a file previously uploaded via api/v1/files/upload. Defaults to 'PlainText'. | |
languages | [] | A collection of languages to consider. If omitted, all supported languages will be 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/detect-language" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "",
"input": "",
"input_format": "PlainText",
"languages": [
"Undefined"
]
}'