Documentation menu

Live voice sessions

Live calls run on your own LiveKit server. Save it once, then pass its id each time you start a session.

A live session is a voice call between a person and one of your agents. The call runs on a LiveKit server that you run. Rezolve Labs does not host one for you yet, so you save your own server before you start a session.

Before you start a live session

You need three things from your LiveKit server:

  • its WebSocket URL, as your clients join it (wss:// only), such as wss://my-project.example.com
  • an API key
  • that key's secret

Then:

  1. Save the server once. Send the URL, key and secret. The secret is stored encrypted and never returned.
  2. Keep the id it returns. The answer's data.id is your server's id.
  3. Pass that id as transportProviderId every time you start a session.

1. Save your LiveKit server

bash
curl -X POST "https://api.rezolvelabs.com/api/v1/developer-platform/livekit-servers" \
  -H "X-API-KEY: $RZLV_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "wss://my-project.example.com", "apiKey": "<livekit key>", "apiSecret": "<livekit secret>", "label": "Production"}'

url, apiKey and apiSecret are required. label is optional and defaults to the URL's host. The answer looks like this:

json
{ "status": "success", "message": "…", "data": { "id": "<server id>", "label": "Production", "url": "wss://my-project.example.com", "createdAt": "…" } }

2. Start a session on it

bash
curl -X POST "https://api.rezolvelabs.com/api/v1/developer-platform/start/session" \
  -H "X-API-KEY: $RZLV_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agentId": "<agent id>", "participantName": "Sam", "transportProviderId": "<server id>"}'
FieldRequiredWhat it is
agentIdYesThe agent to talk to
participantNameNoHow the caller is labelled in the transcript. Defaults to User
transportProviderIdYes, for nowThe id of the LiveKit server you saved

The call is live as soon as this returns. Hand connection.url, connection.token and connection.roomName to the WebRTC client that will do the talking, and connect promptly. The token is short-lived and works for one participant in one room, so don't cache a session or reuse it.

The routes

The same steps work in the developer-platform and agents families. Use the one your key's plan includes.

Stepdeveloper-platformagents
Save a LiveKit serverPOST /developer-platform/livekit-serversPOST /agents/livekit-servers
List your serversGET /developer-platform/livekit-serversGET /agents/livekit-servers
Delete a serverDELETE /developer-platform/livekit-servers/{livekitServerId}
Start a sessionPOST /developer-platform/start/sessionPOST /agents/sessions
List sessionsGET /developer-platform/sessionsGET /agents/sessions
Read a transcriptGET /developer-platform/sessions/{sessionId}/transcriptGET /agents/sessions/{sessionId}/transcript

Each ready-made conversational agent in the agents family, such as /agents/conversational-agents/website-customer-service, also has its own save-livekit, list-livekit and create-session (or start-session) routes. They take the same fields. The API reference lists them all.

422 TRANSPORT_PROVIDER_REQUIRED

A start without transportProviderId, or before your workspace has saved a LiveKit server, is refused with 422 and the code TRANSPORT_PROVIDER_REQUIRED. Your request body was fine: the session just has no server to run on. Nothing is charged and no room is created.

To fix it, save your server (step 1) and send its id as transportProviderId.

No Labs-hosted server yet

Rezolve Labs does not offer a hosted LiveKit server yet, so every live session needs your own.

Other refusals

AnswerWhy
403Your plan doesn't include live sessions, or a publishable (pk) key was used. Starting a session needs a secret key.
409The agent has no saved flow yet, or your plan has no room left for another live session.
425A knowledge base the agent uses isn't searchable yet. Try again once it has finished indexing.

A refused start is never charged.