LM-Kit OneDocs2026.8.10lm-kit.com
AI Analysis

Language Detection

Detects the language of the input text, PDF, HTML, EML, MBOX, MS Office document or image.#

POST/lmkit/v1/detect-language

Analyzes 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 ·

PropertyTypeDescription
modelstring

The ID of the model used for language detection. If not specified, the default model will be used.

inputrequiredstring

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

StatusTypeDescription
200

OK

202

Accepted

400

Bad Request

500application/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"
  ]
}'