Detect Language
POST/language/detect
Detect the language of text or audio content.
Authentication
Authorization: Bearer vm_sk_… with the media.write permission (or all.write). See Authentication.
Request body
application/json
| Field | Type | Description |
|---|---|---|
audio_data | string | Base64 encoded audio data |
audio_url | string | Audio URL to analyze |
include_alternatives | boolean | Include alternative languages |
include_confidence | boolean | Include confidence scores |
max_alternatives | integer | |
text | string | Text to analyze |
Response
200 application/json
| Field | Type | Description |
|---|---|---|
alternative_languages | DetectedLanguage[] | |
is_mixed_language | boolean | |
mixed_languages | DetectedLanguage[] | |
primary_language* | DetectedLanguage | Detected language information. |
processing_time_ms* | integer | |
text_segments | object[] |
{
"alternative_languages": [
{
"confidence": 0,
"dialect": null,
"language_code": "string",
"language_name": "string",
"script": null
}
],
"is_mixed_language": false,
"mixed_languages": [
{
"confidence": 0,
"dialect": null,
"language_code": "string",
"language_name": "string",
"script": null
}
],
"primary_language": {
"confidence": 0,
"dialect": "string",
"language_code": "string",
"language_name": "string",
"script": "string"
},
"processing_time_ms": 0,
"text_segments": [
{}
]
}Errors
401 | Missing, wrong, revoked or expired key. |
403 | The key lacks media.write, the route is not available to keys, or the key's IP allow-list refuses this client. |
402 | Not enough credits, or the key reached its spending cap. |
422 | The request failed validation; `detail` lists the fields. |
429 | Over a rate limit; retry after `Retry-After` seconds. |
All statuses: Errors.
Example
curl -X POST "https://api.voicemint.io/api/v1/language/detect" \
-H "Authorization: Bearer $VOICEMINT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_data": "string",
"audio_url": "string",
"include_alternatives": false,
"include_confidence": true,
"max_alternatives": 3,
"text": "string"
}'