WebSocket API
As WebSockets are more like raw TCP sockets, and allow more fluid communication between the client and server than just request/response mechanics, the WebSocket API offers more functionality than the REST API.
You can stream audio to the WebSocket API, and it will automatically detect when the user has stopped speaking (Voice Activation Detection, or VAD for short) and send the query response without additional calls being needed.
A main goal of the WebSocket API design was to make it familiar to a developer that is used to REST APIs, and Voysis REST APIs in particular, and to keep the names of equivalent concepts in each communication channel consistent with each-other so that it is easy to context switch between the two.
Open Connection
The url for the WebSocket API is /websocketapi
. For example, if your Voysis AI service endpoint is mycompany.voysis.io
, then you would open the websocket at wss://mycompany.voysis.io/websocketapi
.
Updated over 5 years ago