Skip to main content
This quickstart walks the full path to a working voice app: set up your account, then build a browser voice assistant with the official tutorial — or hear your first spoken reply with one short Python script. One session does everything — the model listens and speaks natively, with no separate transcription or synthesis steps to manage.
Looking for an easier path? LiveKit and Pipecat have Higgs Realtime support built in and handle the WebSocket, audio, and interruption plumbing for you — often the fastest route to a production voice agent. Already running on OpenAI’s Realtime API? Migrate your existing integration with a few config changes. This page covers the raw WebSocket path — the best way to learn how the API actually works.

How it works

Your app holds a single WebSocket session and exchanges JSON events with the model: That’s the whole loop. When you stream microphone audio instead of text, turn detection makes the last step automatic — the model replies on its own when you stop speaking, no response.create needed.

Before you begin

Whichever path you take below, you need: New to Boson AI? Set up your account walks through all of it.

Start with the tutorial

The easiest and most practical way to build with Higgs Realtime is the official tutorial: six parts that take you from zero to a working browser voice assistant, with a working checkpoint to fall back on after every part.

Higgs Realtime API — a tutorial

TypeScript and React, verified against live sessions. Clone it, add your key, and build.
The parts arrive in the same order a real voice service comes together: keep your API key off the browser with ephemeral keys, open the first connection, stream a live microphone with turn detection and interruptions, rebuild a correct transcript from the event stream, add tool calling, and shape the system prompt. Finish it and you have touched every building block of a voice app once. Building server-side instead — a phone agent, a voice pipeline — or want the smallest possible first step? The rest of this page plays a spoken reply with one short Python script.

Hear a reply in Python

You need Python 3.10 or later with the websockets and sounddevice packages, and speakers or headphones — the reply plays as audio:
Connect, configure the session, send a text message, and play the model’s spoken reply:
You should hear the assistant speak its reply out loud, then see its transcript printed. The reply arrives as a stream of response.output_audio.delta events (base64 24 kHz 16-bit mono PCM) alongside response.output_audio_transcript.delta text, ending with response.done. To talk instead of type, stream microphone audio with input_audio_buffer.append — with server_vad turn detection the model detects when you stop speaking and responds on its own, no response.create needed.
Building for the browser or mobile? Don’t ship your API key: mint a short-lived key with POST /v1/realtime/client_secrets and connect with the bai-client-secret.<key> subprotocol (see Authentication). The tutorial above builds this flow end to end.

It didn’t work?

sounddevice plays through your system’s default output device. Check that a working output device is selected and unmuted. The transcript print (Assistant: …) confirms the model replied even if playback failed.
Invalid API key (or an invalid/expired ephemeral key). Check BOSON_API_KEY is set in the shell running the script and matches a key in your workspace. See Authentication.
A billing refusal — your key is fine, but the account has no available balance. New accounts must claim their free trial credit first; otherwise add credits in workspace billing. See Common error types.

Go deeper

Connections & sessions

Session configuration, limits, and lifecycle.

Audio & voices

Audio formats, preset voices, and custom voices.

Turn detection & interruptions

server_vad, semantic_vad, and barge-in.

Tool calling

Let the model call your functions mid-conversation.

LiveKit & Pipecat

Production voice-agent frameworks with Higgs Realtime built in.

Migrate from OpenAI

The protocol is OpenAI Realtime compatible — most integrations move with config changes.