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
| Status | Type | Description |
|---|---|---|
| 400 | invalid_request | Malformed or missing audio body. |
| 401 | unauthorized | Missing or invalid API key. |
| 413 | file_too_large | Audio file exceeds the size limit (25MB on free plans, 30MB on paid). |
| 415 | unsupported_media_type | Audio format not supported. Use MP3, WAV, M4A, OGG, FLAC, or OPUS. |
| 429 | quota_exceeded | Monthly audio-minutes quota or per-key rate limit reached. |
| 503 | service_unavailable | The 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