---
title: "Identify the spoken language of an audio file"
method: POST
path: "/api/velma-2-language-detection-batch"
---

# Identify the spoken language of an audio file

`POST /api/velma-2-language-detection-batch`

Accepts a single audio file and returns the detected language as a
synchronous JSON response.

## Response `200`

Language detection completed successfully.

- LanguageDetectionResponse
  - `predicted_language` string, required — Human-readable language name (e.g. `"English"`, `"French"`, `"Mandarin"`). Suitable for display to end users.
  - `predicted_language_code` string, required — Lowercase ISO 639-1 language code (e.g. `"en"`, `"fr"`, `"zh"`). Suitable for routing, locale switching, or BCP-47 tags.
  - `confidence` number, double, required — Probability associated with the predicted language, in the range 0.0-1.0. Higher means more confident.
  - `duration_ms` integer, required — Total duration of the decoded audio in milliseconds. Note: only the first 30 seconds are analyzed regardless of this value.

## Other responses

- `400` — Bad request - the uploaded file is empty, its format is not supported, or the audio could not be decoded.
- `403` — Forbidden - the request is not permitted.
- `422` — Unprocessable entity - a required request parameter is missing or invalid (for example, the `X-API-Key` header or the `upload_file` field).
- `429` — Too many requests - the request could not be completed due to insufficient credits.
- `500` — Internal server error during processing.
- `503` — Service unavailable - the service is temporarily unavailable.
- `504` — Gateway timeout - processing timed out.

---

[API](https://skmtc.dev/modulate/apis/velma-2-accent-batch-api.md) · [All operations](https://skmtc.dev/modulate/apis/velma-2-accent-batch-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/modulate/velma-2-accent-batch-api/revisions/b4c9ce648efa/schema)
