LM-Kit OneDocs2026.8.10lm-kit.com
Speech

Voice Activity Detection

Detects the speech regions of an audio or video file (JSON: base64 or file identifier).#

POST/lmkit/v1/voice-activity-detection

Runs the built-in Silero voice-activity-detection model over the audio and returns the time ranges that contain speech, with the total speech time and the audio duration. No transcription model is involved: the pass is CPU-only and needs nothing downloaded or loaded, so it is fast even on servers without a speech model. Typical uses: segmenting a recording before transcription, skipping silence in long audio, or measuring how much of a file is actually spoken. The optional 'vad' object tunes detection (threshold, minimum durations, padding).

Accepts an audio or video file as base64 (input_format 'Base64EncodedFile') or as the identifier of a previously uploaded file (input_format 'FileIdentifier'). Decoding shares the transcription pipeline: the formats the server can decode are reported by GET /lmkit/v1/audio-transcription/capabilities, and a video's audio track is extracted. A video that declares no audio track answers 422 Unprocessable Content. If processing exceeds the configured timeout, returns 202 Accepted with a job_id; poll GET /lmkit/v1/jobs/ for status and results.

Large files: the base64 body is bounded by the configured "Max upload size" (default 100 MB), but base64 inflates a file by ~33% and is buffered whole in memory. For large or long recordings prefer either (a) POST the raw file to /lmkit/v1/voice-activity-detection/file (multipart, streamed to disk), or (b) POST it once to /lmkit/v1/files/upload and reference the returned fileId here with input_format 'FileIdentifier'. An oversized body is rejected with 413 Payload Too Large.

Request body

application/json ·

PropertyTypeDescription
inputrequiredstring

The audio or video file to analyze (a video's audio track is extracted). When input_format is 'Base64EncodedFile', provide a base64-encoded file payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint. Supported formats: see GET /lmkit/v1/audio-transcription/capabilities (the two endpoints share one decoder).

input_format

How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded audio file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.

vad

Optional detection tuning. Omitted fields keep the engine defaults.

Responses

StatusTypeDescription
200

OK

202

Accepted

400

Bad Request

404

Not Found

413

Payload Too Large

422

Unprocessable Entity

500application/json

Internal Server Error

curl -X POST "$LMKIT_ONE_URL/lmkit/v1/voice-activity-detection" \
  -H "Authorization: Bearer $LMKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "",
  "input_format": "Base64EncodedFile",
  "vad": {
    "energy_threshold": "string",
    "min_speech_ms": "string",
    "min_silence_ms": "string",
    "max_speech_s": "string"
  }
}'

Detects the speech regions of an uploaded audio or video file (multipart/form-data).#

POST/lmkit/v1/voice-activity-detection/file

Accepts an audio or video file as a raw multipart/form-data upload (form field 'file'). This is the recommended path for large or long recordings: the file is streamed to disk rather than buffered whole in memory, and no base64 inflation applies. The upload is bounded by the configured "Max upload size" (default 100 MB); an oversized file is rejected with 413 Payload Too Large. Detection tuning is available on the JSON endpoint's 'vad' field. Behaves identically to the JSON endpoint otherwise: returns the speech segments with the total speech time, or 202 Accepted with a job_id when processing exceeds the configured timeout (poll GET /lmkit/v1/jobs/).

Request body

application/x-www-form-urlencoded · object

PropertyTypeDescription
ContentTypestring
ContentDispositionstring
Headersobject
Lengthobject (int64)
Namestring
FileNamestring

Responses

StatusTypeDescription
200

OK

202

Accepted

400

Bad Request

413

Payload Too Large

422

Unprocessable Entity

500application/json

Internal Server Error

curl -X POST "$LMKIT_ONE_URL/lmkit/v1/voice-activity-detection/file" \
  -H "Authorization: Bearer $LMKIT_API_KEY" \
  -H "Content-Type: application/x-www-form-urlencoded"