Web SDK
@waylovoice/client joins the call, opens the microphone, plays the agent's voice, and reports call state and live captions. Framework-free TypeScript.
Developers
Build agents in the dashboard, from your servers with the REST API, or from an AI agent through the MCP server. Add web calls with the Web SDK.
Quickstart
Your server holds the API key and asks Waylo for a fresh session for each call. Your page gives the SDK that route's URL.
// Your server: one route. Node 20.6+ with Express. The API key never reaches the browser.
app.post("/api/waylo/session", express.json(), async (req, res) => {
const user = await findLoggedInUser(req); // your own login
if (!user) return res.status(401).json({ error: "auth_required" });
const { agentId } = req.body ?? {};
if (agentId !== AGENT_ID) return res.status(403).json({ error: "access_denied" });
const upstream = await fetch(`${WAYLO_API_URL}/sessions/web`, {
method: "POST",
headers: {
Authorization: `Bearer ${WAYLO_API_KEY}`, // sk_waylo_…, scope sessions:write
"Content-Type": "application/json",
},
body: JSON.stringify({ workspaceId: WORKSPACE_ID, agentId }),
}).catch((error) => console.error("Waylo API unreachable:", error.cause?.code ?? error.name));
// A Waylo 401, 403 or 404 is about your setup, not the visitor: log it and answer 502.
if (!upstream?.ok) return res.status(upstream?.status === 429 ? 429 : 502).end();
res.set("Cache-Control", "no-store").type("application/json");
res.status(200).send(await upstream.text()); // forward it unchanged
});Already have an agent?
The replies come from one of two places: Waylo Voice's managed model, or your own agent.
Step 1
Point Waylo Voice at your agent’s OpenAI API-compatible endpoint. Waylo sends each caller turn there and speaks the reply.
Step 2
Buy a US local number from Waylo, or bring your own from a supported carrier such as Twilio.
Step 3
Pick the voice. Waylo handles listening, turn-taking and speaking.
Step 4
Calls reach your agent. Read every session and transcript after, or get them by webhook.
// PATCH /agents/{id} (or the updateAgent tool on the MCP server)
// Your agent: an OpenAI-compatible Chat Completions endpoint, streamed, on public HTTPS.
// Send brainUrl and brainModel together; all three as null removes it.
{
"brainUrl": "https://your-agent.example.com/v1",
"brainModel": "your-agent",
"brainCredentialId": "<credential holding your endpoint's key>"
}
// Waylo adds /chat/completions to brainUrl.
// Key scopes: agents:write, transcripts:read, and credentials:write for the credential.@waylovoice/client joins the call, opens the microphone, plays the agent's voice, and reports call state and live captions. Framework-free TypeScript.
What the dashboard does for agents, drafts and versions, tools, documents, phone numbers, web and outbound calls, live-call control, sessions, transcripts and orders. Authenticate with scoped API keys.
Connect Claude Code, Claude Desktop, Cursor or another MCP client. Sign in once and the agent can build and publish agents, attach tools and documents, and read sessions for you.
Receive call events as they happen, such as a session starting, each transcript line as it's final, and how it ended.
Point an agent at your agent's OpenAI API-compatible endpoint, streamed over public HTTPS. Waylo sends each turn there and speaks the reply.
Describe an HTTPS endpoint and the agent calls it mid-call, with stored credentials and optional signing.