Skip to main content
Build real-time voice and chat experiences with Dasha BlackBox. WebSockets provide instant bidirectional communication with agents for browser-based voice calls, live chat, and client-side tool execution. What you’ll learn: Connection lifecycle, call types, and when to use WebSockets vs REST.
All WebSocket examples require authentication with a web integration token or API key.

Connection lifecycle

1

Connect

Establish WebSocket connection to Dasha BlackBox server
2

Authenticate

Send initialize message with call configuration
3

Communicate

Exchange messages bidirectionally (chat or voice via WebRTC)
4

Disconnect

Send terminate to end gracefully

Connection endpoints

The dev endpoint requires your API key and should never be exposed in client-side code.

Call types


Quick start: Chat


When to use WebSockets vs REST

Use WebSockets for:
  • Real-time chat conversations
  • Browser-based voice calls (WebRTC)
  • Tool execution with immediate results
Use REST API for:
  • Creating and configuring agents
  • Enqueueing outbound phone calls
  • Fetching call history and results
Most applications use both: REST for setup, WebSockets for runtime communication.

Message types

Client → Server

Server → Client

Message Reference

Complete schema documentation

What’s next

Chat Implementation

Build a complete text chat interface

Voice Call Implementation

Add WebRTC voice calls

Message Reference

Complete message schemas

Tool Execution

Handle agent tool calls