> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.omicx.one/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.omicx.one/_mcp/server.

# Speech to Text

Để nhận các sự kiện dưới đây, đăng ký webhook với `events` chứa mã
`AI_STT:COMPLETED` và/hoặc `AI_STT:FAILED` (xem [Danh sách sự kiện hỗ trợ](/integrations/webhooks/webhook-event-catalog)).

## AI_STT:COMPLETED

Gửi khi job Speech to Text (`POST /stt`) xử lý xong. `data` giống hệt
response của endpoint đồng bộ tương ứng (`SttResponse`).

```json
{
  "event": "AI_STT:COMPLETED",
  "data": {
    "trackingId": "018f8b3c-5e2a-7c1a-9b3e-3a2c1e4f5a6b",
    "transcript": "Xin chào, đây là bản ghi âm từ OMICX",
    "audioDuration": 5,
    "fileSizeBytes": 245760,
    "inputAudioFileName": "recording.wav",
    "inputAudioUrl": "https://storage.omicx.one/stt-input/xyz789.wav?X-Amz-Expires=300",
    "processingTimeMs": 842
  }
}
```

**Lưu ý:** `inputAudioUrl` là presigned URL tạm thời — có thể đã hết hạn
vào thời điểm bạn nhận được webhook.

## AI_STT:FAILED

Gửi khi job Speech to Text (`POST /stt`) xử lý thất bại. `data` dùng
chung định dạng lỗi (`ErrorResponse`) như endpoint đồng bộ.

```json
{
  "event": "AI_STT:FAILED",
  "data": {
    "error": {
      "code": "BAD_GATEWAY",
      "subCode": "AI_PROVIDER_ERROR",
      "message": "STT processing failed",
      "timestamp": "2026-01-01T00:00:00Z",
      "path": "/stt"
    }
  }
}
```