Agent WebSockets

Establish a WebSocket connection for real-time conversations with an AI agent.

Handshake

WSS
/v1/convai/conversation

Query parameters

agent_idanyRequired
The unique identifier for the voice to use in the TTS process.

Send

User Audio ChunkobjectRequired
Send audio data chunks from the user to the server for processing.
OR
PongobjectRequired
Response message to server ping requests for latency measurement.
OR
Conversation Initiation Client DataobjectRequired
Client configuration data to override default conversation settings.
OR
Client Tool ResultobjectRequired

Results from client-side tool execution requested by the server.

OR
Contextual UpdateobjectRequired

Non-interrupting content sent to update the conversation state without disrupting the flow.

OR
User MessageobjectRequired
Text message sent by the user to the conversation.
OR
User ActivityobjectRequired
Activity ping to prevent agent interruption and indicate user presence.
OR
Multimodal MessageobjectRequired
A message combining text and a file reference, sent by the user to the conversation.

Receive

Conversation Initiation MetadataobjectRequired
Initial metadata and configuration details for a new conversation.
OR
User TranscriptobjectRequired

Real-time transcriptions of user speech input.

OR
Agent ResponseobjectRequired
Text responses generated by the AI agent.
OR
Agent Response CorrectionobjectRequired
Correction to a previous agent response.
OR
Audio ResponseobjectRequired
Synthesized audio chunks of the agent's speech response.
OR
InterruptionobjectRequired
Notification that the agent's current response was interrupted.
OR
PingobjectRequired

Server-initiated ping messages for measuring connection latency.

OR
Client Tool CallobjectRequired
Requests from server for client to execute specific tool functions.
OR
Contextual UpdateobjectRequired

Non-interrupting content sent to update the conversation state without disrupting the flow.

OR
VAD ScoreobjectRequired
Voice Activity Detection scoring information.
OR
Internal Tentative Agent ResponseobjectRequired
Preliminary response from the agent before final confirmation.
OR
Agent Response CompleteobjectRequired

Emitted when the agent has finished responding and no further responses are expected without additional user input. Only fires when turn_timeout is disabled.