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...
Detect the source language for one logical text payload. No target language is required.
/api/v1/translate/detectNative detection endpoint.
Request example
/api/v1/translate/detectcurl -X POST "https://translate.lexel.ai/api/v1/translate/detect" \-H "Authorization: Bearer lxl_your_api_key" \-H "Content-Type: application/json" \-d '{"request_id": "req_detect_demo_001","content_mode": "plain","input": {"items": [{"txt": "地獄、それは他人である。"}]}}'
Response example
{"ok": true,"request_id": "req_detect_demo_001","operation": "detect","source_language_tag": "ja-Jpan","source_language_name": "Japanese","detection_confidence": 0.98,"inference_latency": 87,"output": {"kind": "detect"},"warnings": [],"lowConfidence": false,"fallbackSuggested": false}
| Field | Type | Required | Description |
|---|---|---|---|
| request_id | string | Yes | Caller-provided trace ID returned in the response. |
| content_mode | auto | plain | markdown | html | json | xml | yaml | csv | No | Optional content mode. Structured content is preprocessed before detection. |
| input.items | array(length = 1) | Yes | Detection accepts exactly one logical item. |
| input.items[0].txt | string | Yes | Text to detect. |
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | Yes | True when detection succeeds. |
| request_id | string | Yes | Echoes the request ID. |
| operation | "detect" | Yes | Response operation discriminator. |
| source_language_tag | string | Yes | Canonical detected language tag. |
| source_language_name | string | No | Human-readable detected language name. |
| detection_confidence | number | null | No | Provider-backed confidence when available. |
| inference_latency | number | null | No | Provider-reported inference latency in milliseconds when available. |
| lowConfidence | boolean | Yes | True when confidence falls below the route threshold. |
| fallbackSuggested | boolean | Yes | Legacy uncertainty hint mirroring lowConfidence. It does not control provider routing. |
| warnings | array | Yes | Non-fatal detection warnings. |
Some clients also accept camelCase aliases such as language, detectionConfidence, and inferenceLatency, but responses use snake_case fields above.