---
title: "Decide which language a voice turn was spoken in, from its WAV recording"
method: POST
path: "/api/lia/speech/detect_language"
tags: ["Lia"]
---

# Decide which language a voice turn was spoken in, from its WAV recording

`POST /api/lia/speech/detect_language`

## Request

- Base URL: `https://api.leapsurgebi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.leapsurgebi.com/api/lia/speech/detect_language`
- Auth: OAuth 2
  - Password
  - Token URL: `/auth/token`
- TypeScript: <https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/docs/api/lia/speech/detect_language/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns {"language", "text", "reason", ...}. language is null when no decision
could be made; `reason` then says why, and the frontend falls back to Azure's
own identification. transcripts / errors / timings are there for diagnosis.

## Request body `multipart/form-data`

- BodyDetectSpokenLanguageApiLiaSpeechDetectLanguagePost
  - `audio` string, binary, required
  - `max_seconds` number
  - `language` string
  - `hint` string

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-24** `23b42df3193a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/changes/api/lia/speech/detect_language/post.md)

---

[API](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi.md) - [All operations](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/llms.txt) - [OpenAPI document](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/revisions/13653cb8ee76?raw)
