Voice calls on your website
Let visitors talk to your agent right in the browser — a real-time voice call with no phone number involved. Great for in-app voice support and demo experiences; your developer wires it up with a few lines of code.
A web call runs your voice agent inside the visitor's browser. They click a button on your site, allow the microphone, and talk — no phone line, no phone number, and responses fast enough to feel like a real conversation (under 300ms). It's ideal for in-app voice support, demo widgets, or anywhere you want voice without telephony.
How it works
Your website asks Qalyb for a one-time pass to a fresh, private call room where your agent is already waiting. The visitor's browser joins that room and starts streaming their microphone — from there it's a normal conversation with your agent, live in the page.
The microphone prompt
The browser asks the visitor for microphone access the first time they connect. One rule to respect: the call must start from a click (or another deliberate action) — browsers block microphone access that tries to start on its own when the page loads. So put the call behind a clear "Start call" button.
When the call ends
Hanging up ends the call. The agent runs its configured "wrap up" prompt, the post-call analysis kicks off, and you get the same webhook events as a regular phone call — so your reporting and follow-ups work identically across both.
For developers
Under the hood, Qalyb mints a one-time LiveKit token bound to a fresh room with the agent already dispatched into it. Your browser connects to that room with the standard LiveKit client SDK and streams microphone audio.
Mint the session from your backend — never expose your sk-live- key in the browser:
curl -X POST https://api.qalyb.ai/v1/agents/agt_abc123/web-call \
-H "Authorization: Bearer sk-live-..." \
-H "Content-Type: application/json" \
-d '{ "variables": { "customer_name": "Layla" } }'The response gives you everything the browser needs:
{
"id": "call_def456",
"livekitUrl": "wss://livekit.qalyb.ai",
"livekitToken": "eyJhbGciOi...",
"roomName": "web-agt_abc123-1715190000000"
}End-to-end in TypeScript:
import { Qalyb } from '@qalyb/sdk';
import { Room } from 'livekit-client';
const qalyb = new Qalyb({ apiKey: process.env.QALYB_API_KEY! });
// Server-side: mint a session bound to the agent.
const session = await qalyb.agents.startWebCall('agt_abc123', {
variables: { customer_name: 'Layla' },
});
// Client-side: connect with the LiveKit token.
const room = new Room();
await room.connect(session.livekitUrl, session.livekitToken);
await room.localParticipant.setMicrophoneEnabled(true);Two implementation notes: mount your call component only after a user gesture, since browsers block getUserMedia from auto-running on page load — and disconnecting the LiveKit room is what ends the call.
