POST /api/v1/transcribe

Speech-to-text for Khmer and English audio. Raw audio body (octet-stream), returns JSON.

Authentication

Bearer token API key in the Authorization header. Keys start with ds_sk_.

Request

POST /api/v1/transcribe HTTP/1.1
Host: doslarb.cloud
Authorization: Bearer ds_sk_...
Content-Type: audio/wav

<raw binary audio bytes>

Supported formats

MP3, WAV, M4A, OGG, FLAC, OPUS. Browser MediaRecorder uploads accepted.

Response

On success the body is JSON with the recognised text, a confidence score, the audio duration_seconds, and the model that produced it.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "text": "...",
  "confidence": 0.95,
  "duration_seconds": 14.2,
  "model": "ds-stt-v2"
}

Error codes

StatusTypeDescription
400invalid_requestMalformed or missing audio body.
401unauthorizedMissing or invalid API key.
413file_too_largeAudio file exceeds the size limit (25MB on free plans, 30MB on paid).
415unsupported_media_typeAudio format not supported. Use MP3, WAV, M4A, OGG, FLAC, or OPUS.
429quota_exceededMonthly audio-minutes quota or per-key rate limit reached.
503service_unavailableThe speech engine is temporarily unavailable. Retry after a short delay.

Example

bash
curl -X POST https://doslarb.cloud/api/v1/transcribe \
  -H "Authorization: Bearer ds_sk_..." \
  -H "Content-Type: application/octet-stream" \
  --data-binary @audio.mp3