Skip to main content

WebSocket API

Real-time bidirectional streaming API for Speech-to-Text (STT) and Text-to-Speech (TTS) services.

Overview

The 60db WebSocket API provides real-time streaming capabilities for:
  • Speech-to-Text (STT): Convert audio to text with 99+ language support
  • Text-to-Speech (TTS): Synthesize natural-sounding speech with multiple voices

Base URLs

Authentication

WebSocket connections require authentication using API key via query parameter:
Getting Your API Key:
  1. Go to app.60db.ai
  2. Navigate to Settings β†’ Developer β†’ API Keys
  3. Click Create API Key
  4. Copy and store your API key securely

🎀 STT WebSocket (Speech-to-Text)

What it does: You send audio β†’ You get text back Use for: Transcribing speech, voice commands, call center analytics, meeting transcription

Quick Start

How STT Works


πŸ”Š TTS WebSocket (Text-to-Speech)

What it does: You send text β†’ You get audio back Use for: Voice assistants, audiobooks, accessibility, chatbots

Quick Start

How TTS Works


πŸ“‹ STT vs TTS Comparison


πŸ€– Voice agent calls over WebSocket

Connect call audio you already carry over a WebSocket (a PBX, a telephony platform such as Twilio, Exotel or Klicko, or your own app) to a 60db voice agent. No phone line or UDP ports needed.
  1. Your server calls Start stream call (POST /agents/{agentId}/stream-calls, API key with the agents scope).
  2. You get a one-time URL: wss://api.60db.ai/ws/agents/stream/{callId}?token=… (single use, 55 seconds). It carries no API key.
  3. Connect and send start within 10 seconds:
    • Native style: {"event":"start","format":"mulaw"} (or pcm16), then binary 20 ms frames of 8 kHz audio both ways.
    • Twilio Media Streams style: your usual connected and a start with mediaFormat, then base64 media events.
  4. The agent’s clear (barge-in), dtmf, transfer, hangup and ended messages arrive as JSON. Keep messages under 4 KB.
Up to 3 at once per workspace. Billed as AI credits only (about $0.016 per minute of conversation). Full guide: Agent Stream WebSocket.

πŸ“š Full Documentation


πŸ’‘ Key Concepts

STT Messages

TTS Messages


πŸ“Š Pricing


πŸ†˜ Support