Developer's Docs
Websocket Streaming
How to use our websocket in your application to call your agent
Use the desired personality id under your account in the WebSocket URL.
Here is an example:
OPENHOME_API_KEY
Checkout API Docs to get OPENHOME_API_KEY
PERSONALITY_ID
Checkout Get Personalities section to get your account’s personality ids.
- 4727: Represents the personality ID.
- Set the personality ID to
0
to skip this part. This will start the call with the default agent, OpenHome.
WebSocket Flow
Audio Data Format
Audio data sent to the WebSocket must adhere to the following specifications:
- Format: 16-bit PCM
- Sample Rate: 16000 Hz
- Encoding: Base64
Ensure that the audio is converted to this format before sending it to the WebSocket.
WebSocket Message Structure
Client to Server Messages
- User to Server Text Messages
- User to Server Audio Messages
Server to Client Messages
-
Server to User Text Messages
live: true indicates live transcription or response logs.
final: true provides finalized transcription and response messages.
-
Server to User Audio Messages
EXAMPLES
Find More Examples on GitHub