POST
/
text-lid
curl --request POST \
  --url https://api.sarvam.ai/text-lid \
  --header 'Content-Type: application/json' \
  --data '{
  "input": "<string>"
}'
{
  "request_id": "<string>",
  "language_code": "<string>",
  "script_code": "<string>"
}

Headers

api-subscription-key
string
default:

Your unique subscription key for authenticating requests to the Sarvam AI APIs. Here are the steps to get your api key

Body

application/json
input
string
required

The text input for language and script identification.

Response

200
application/json
Successful Response
request_id
string | null
required
language_code
string | null

The detected language code of the input text.

Available languages:

  • en-IN: English
  • hi-IN: Hindi
  • bn-IN: Bengali
  • gu-IN: Gujarati
  • kn-IN: Kannada
  • ml-IN: Malayalam
  • mr-IN: Marathi
  • od-IN: Odia
  • pa-IN: Punjabi
  • ta-IN: Tamil
  • te-IN: Telugu
script_code
string | null

The detected script code of the input text.

Available scripts:

  • Latn: Latin (Romanized script)
  • Deva: Devanagari (Hindi, Marathi)
  • Beng: Bengali
  • Gujr: Gujarati
  • Knda: Kannada
  • Mlym: Malayalam
  • Orya: Odia
  • Guru: Gurmukhi
  • Taml: Tamil
  • Telu: Telugu