Detect language from audio with a speech-to-text API
Detect the language spoken in an audio file: run speech-to-text with no language hint, then read the detected code and confidence from the result.

To detect the language of an audio file with an API, run speech-to-text without a language hint and read the detected language code from the result; the same call gives you the transcript. Sume STT 1.0 auto-detects when you omit language_code, and its result reports language_code and a language_probability confidence when they are available.
STT 1.0 is specified in the OpenAPI document behind the Sume API reference, which the API reference docs page names as the source for exact request and response shapes. The video route is in Video inspect. All were read on 2026-09-27.
How do I detect the spoken language with an API?
Send the audio with no language_code. The API reference's own auto_detect_language example is exactly that: an audio_url and a mode, nothing else. The URL must be public HTTPS; the request below also sets duration_seconds, which sizes the usage reservation.
After the submit, poll GET /v1/jobs/{id}/status until terminal is true, or pass a webhook_url, then read the language fields from GET /v1/jobs/{id}/result.
curl -X POST https://api.sume.com/v1/stt-1.0/transcribe \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: detect-lang-call-0117" \
-d '{
"audio_url": "https://example.com/audio/call-0117.wav",
"duration_seconds": 90,
"mode": "async"
}'What does the result tell me?
A completed result carries these fields under data.result. Both language fields are “when available”, so code for a result without them. The reference calls language_probability a confidence without giving its scale, so pick your cutoff from results on your own files.
| Field | What the reference says | Use it to |
|---|---|---|
language_code | Detected or requested language code, when available | Route the file to translation, captions, storage, or a reviewer |
language_probability | Language detection confidence, when available | Hold uncertain files for a person |
text | The transcript text | Keep it: the detection already paid for it |
words[] | Each token with start and end in seconds from the audio start | Time captions, search, or excerpts |
// data from GET /v1/jobs/{id}/result
const { language_code, language_probability, text } = data.result;
const unsure =
!language_code ||
(language_probability != null && language_probability < MIN_CONFIDENCE);
if (unsure) sendToReview(file, text); // MIN_CONFIDENCE: your own cutoff
else routeByLanguage(file, language_code, text);Should I pass a language hint instead?
Only when you already know the language. language_code is an optional BCP-47 hint of 2–16 characters, such as en or ko. With a hint, the result's language_code can be the code you requested rather than one it detected, so it may only echo your hint.
Leave the hint off for unlabeled files, and set it for files you have already sorted, such as a Korean-only archive.
Can I detect the language of a video?
Yes, if the video is on Sume. Video inspect with transcribe: true runs STT 1.0 on a clip on your workspace's media.sume.com, and its language_code works the same way: omit it for auto-detect. In the API reference, the inspect transcript has a language_code field but no language_probability.
For a video file of your own, send its audio track to STT 1.0, as in Transcribe video to text with an API.
What does detection cost, and what are the limits?
- Detection comes with a full transcription, billed at $0.01 per audio minute on API pricing, plus a 5.5% agent fee by default. To spend less on long recordings, send a short excerpt: fewer audio minutes cost less.
- One file per request, up to 10 minutes:
duration_secondsruns 1–600. Omit it and Sume reserves 1 minute. - The result has one
language_codefor the whole file. The reference doesn't say how a recording that switches languages is labeled. - The reference names
enandkoas example hints. Test detection on recordings like yours before you rely on it.
Sources
Related posts
More in Media tools
- Facebook in-stream ads: video specs and the 15-second rule
Facebook in-stream video ads: 16:9 or 1:1, at least 1080×1080, 5–15 s on desktop. Ads of 15 s or less play in full; longer ones stop at 15 s.
- How to fix audio delay in a video by shifting the sound
Fix a video whose sound runs late or early: detach the audio and re-render the clip with the offset set as audio.source_in or the slot's source_in.
- How to freeze frame a video: hold the last or any frame
Freeze a video's last frame with one tpad filter call, or hold any frame mid-clip as a still between two parts of the clip in a Timeline render.
- How to generate an SRT file from a video
To generate an SRT file from a video, transcribe it with timestamps and write each timed sentence as a numbered block. Sume's STT returns timed JSON.
Written by Sume