Messages
{
"type": "stt",
"payload": {
"audioBase64": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA=",
"language": "ar",
"isEosEnabled": true,
"eosThreshold": 0.3,
"model": "s2"
}
}"مرحبا بك في خدمة همسة"{
"type": "error",
"payload": {
"message": "Invalid payload for message type: stt"
}
}WebSocket Playgrounds
Speech-to-Text
Transcribe audio to text via WebSocket
WSS
/
Connect to the WebSocket and send STT requests to transcribe audio into text.
Quick Start
- Enter your API key in the authentication field
- Click Connect to establish the WebSocket connection
- Provide base64-encoded audio data
- Click Send to receive transcription
Request Message
After connecting, send a JSON message with the following structure:string
required
Must be
"stt"object
required
Show payload properties
Show payload properties
string
required
Base64-encoded audio data.
string
default:"ar"
Language code for transcription. Defaults to
"ar" (Arabic).boolean
default:"true"
Enable end-of-speech detection.
number
default:"0.3"
Threshold for end-of-speech detection (0.0 to 1.0).
string
default:"s2"
The STT model to use for transcription. One of:
s2, s3. Defaults to s2.STT Request
{
"type": "stt",
"payload": {
"audioBase64": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA=",
"language": "ar",
"isEosEnabled": true,
"eosThreshold": 0.3,
"model": "s2"
}
}
Response Format
Transcription Result
مرحبا بك في خدمة همسة
Error Response
{
"type": "error",
"payload": {
"message": "Error generating transcription: Audio format not supported"
}
}
Supported Audio Formats
Any audio format supported by the backend (WAV, MP3, etc.), base64-encoded.Messages
{
"type": "stt",
"payload": {
"audioBase64": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA=",
"language": "ar",
"isEosEnabled": true,
"eosThreshold": 0.3,
"model": "s2"
}
}"مرحبا بك في خدمة همسة"{
"type": "error",
"payload": {
"message": "Invalid payload for message type: stt"
}
}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
Was this page helpful?