---
title: "Detect language"
method: POST
path: "/detect-language"
tags: ["Detection"]
---

# Detect language

`POST /detect-language`

Detect the language (including dialects) from a given input text using an external model.

## Request body

- object
  - `text` string, required — Text to analyze
  - `api_key` string, required — API key to access the external language model
  - `api_url` string, required — URL of the external API model

## Response `200`

Language successfully detected

- object
  - `detected_lang` string — Language code in NLLB format

## Other responses

- `400` — Invalid request
- `500` — Internal server error

---

[API](https://skmtc.net/smartly/apis/smartly-ai-apis.md) · [All operations](https://skmtc.net/smartly/apis/smartly-ai-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smartly/smartly-ai-apis/revisions/1e26909d86c9/schema)
