> ## Documentation Index
> Fetch the complete documentation index at: https://dat-48188875.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Transcribe

> Speech-to-text with Whisper (async/sync/status)

## 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):

```json theme={null}
{ "task_id": "stt:..." }
```

## `POST /api/whisper/transcribe/sync`

Response (JSON):

```json theme={null}
{
  "task_id": "stt:...",
  "success": true,
  "payload": "transcribed text ...",
  "execution_time_ms": 12345
}
```

If the task failed, an additional field may be present:

```json theme={null}
{ "error": "..." }
```

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

Example response (JSON):

```json theme={null}
{
  "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:

```json theme={null}
{ "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):

```bash theme={null}
curl -sS -X POST "https://llm.dat.ai/api/whisper/transcribe/async" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "audio=@sample.wav"
```

Sync (multipart):

```bash theme={null}
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):

```bash theme={null}
curl -sS -X POST "https://llm.dat.ai/api/whisper/transcribe/async" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-binary "@sample.wav"
```

Status:

```bash theme={null}
curl -sS -X GET "https://llm.dat.ai/api/whisper/transcribe/status?task_id=stt:YOUR_TASK_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"
```
