Skip to main content
WSS
wss://api.tryhamsa.com/v1/realtime/ws
Messages
api_key
type:httpApiKey

API key passed as query parameter or X-Api-Key header

STT Request
type:object

Request to transcribe audio to text

STT Response
type:string

Transcribed text result

Error Response
type:object

Error message from the server

Connect to the WebSocket and send STT requests to transcribe audio into text.

Quick Start

  1. Enter your API key in the authentication field
  2. Click Connect to establish the WebSocket connection
  3. Provide audio data (base64 or float array)
  4. Click Send to receive transcription

Request Message

After connecting, send a JSON message with the following structure:
type
string
required
Must be "stt"
payload
object
required
Either audioBase64 or audioList must be provided, not both.
STT Request (Base64)
{
  "type": "stt",
  "payload": {
    "audioBase64": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA=",
    "language": "ar",
    "isEosEnabled": true,
    "eosThreshold": 0.3
  }
}
STT Request (Float Array)
{
  "type": "stt",
  "payload": {
    "audioList": [0.001, 0.0015, -0.002, 0.003, -0.001, 0.002],
    "language": "ar",
    "isEosEnabled": true,
    "eosThreshold": 0.3
  }
}

Response Format

Transcription Result
مرحبا بك في خدمة همسة
Error Response
{
  "type": "error",
  "payload": {
    "message": "Error generating transcription: Audio format not supported"
  }
}
The transcribed text is returned as a plain string, not wrapped in JSON.

Supported Audio Formats

  • Base64: Any audio format supported by the backend (WAV, MP3, etc.)
  • Float Array: Raw PCM samples at 16kHz sample rate, mono channel