API Reference

Complete reference for the Doslarb Cloud REST API.

Authentication

Include your API key in the Authorization header as a Bearer token. All requests must use HTTPS.

Authorization: Bearer YOUR_API_KEY
POST/api/v1/transcribe
Transcribe Audio

Upload an audio file and receive Khmer and English transcripts.

Parameters

NameTypeRequiredDescription
filebinaryYesAudio file in MP3, WAV, M4A, OGG, FLAC, or OPUS format
modelstringNoModel identifier. Default: ds-stt-v2

Response

json
{
  "text": "transcribed text here",
  "confidence": 0.95,
  "duration_seconds": 14.2,
  "model": "ds-stt-v2"
}

Examples

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

Convert Khmer or English text to speech. Returns raw MP3 audio (audio/mpeg).

Parameters

NameTypeRequiredDescription
textstringYesThe text to synthesize. Up to 1200 characters on free plans, 20000 on paid.
voicestringNoVoice slug: "sovann" (Sovann) or "puthi" (Puthi). Default: "sovann"

Examples

bash
curl -X POST https://doslarb.cloud/api/v1/tts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "សួស្តី! សូមស្វាគមន៍មកកាន់ Doslarb Cloud — បច្ចេកវិទ្យាបំប្លែងអក្សរទៅជាសម្លេងសម្រាប់ភាសាខ្មែរ។", "voice": "sovann"}' \
  --output speech.mp3

Error Codes

Status CodeError TypeDescription
400invalid_requestMalformed request body or missing required fields
401unauthorizedMissing or invalid API key
413file_too_largeAudio file exceeds maximum size limit
415unsupported_media_typeAudio format not supported
429quota_exceededMonthly request or audio-minutes quota reached. Upgrade your plan to continue.
429rate_limit_exceededPer-key rate limit exceeded. See Retry-After and X-RateLimit-* response headers.
503service_unavailableSTT engine temporarily unavailable. Retry after delay.