Skip to main content

Endpoints

  • POST /api/whisper/transcribe/async — create a task and return task_id immediately
  • POST /api/whisper/transcribe/sync — create a task and wait for the result
  • GET /api/whisper/transcribe/status?task_id=... — get task status (and result if ready)

Audio input formats

Two request formats are supported:
  1. multipart/form-data with file field audio
  2. Raw audio bytes in the request body (any Content-Type)
Multipart limit: 100MB.

POST /api/whisper/transcribe/async

Response (JSON):
{ "task_id": "stt:..." }

POST /api/whisper/transcribe/sync

Response (JSON):
{
  "task_id": "stt:...",
  "success": true,
  "payload": "transcribed text ...",
  "execution_time_ms": 12345
}
If the task failed, an additional field may be present:
{ "error": "..." }

GET /api/whisper/transcribe/status?task_id=...

Example response (JSON):
{
  "task_id": "stt:...",
  "status": "completed",
  "created_at": "2026-02-17T10:00:00Z",
  "completed_at": "2026-02-17T10:00:12Z",
  "success": true,
  "payload": "transcribed text ..."
}

Errors

Error format:
{ "error": "..." }
Typical status codes:
  • 400: missing audio / missing task_id (status) / multipart error.
  • 401: missing/invalid API key.
  • 403: the task belongs to a different user.
  • 404: task not found.
  • 405: method is not allowed.
  • 504: sync wait timeout.

curl examples

Async (multipart):
curl -sS -X POST "https://llm.dat.ai/api/whisper/transcribe/async" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "audio=@sample.wav"
Sync (multipart):
curl -sS -X POST "https://llm.dat.ai/api/whisper/transcribe/sync" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "audio=@sample.wav"
Async (raw bytes):
curl -sS -X POST "https://llm.dat.ai/api/whisper/transcribe/async" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-binary "@sample.wav"
Status:
curl -sS -X GET "https://llm.dat.ai/api/whisper/transcribe/status?task_id=stt:YOUR_TASK_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"