Skip to main content

POST /api/agent-session

Creates a LiveKit room and starts an agent in-process for the in-browser playground. Returns the credentials needed to join the room.

POST — Create session

Request

{
  "nodes": [...],
  "edges": [...],
  "livekit": {
    "url": "wss://your-project.livekit.cloud",
    "apiKey": "APIxxxxxxxxxx",
    "apiSecret": "your-secret"
  },
  "apiKeys": {
    "openai": "sk-...",
    "elevenlabs": "..."
  }
}
FieldTypeRequiredDescription
nodesSimpleNode[]Serialized graph nodes
edgesSimpleEdge[]Serialized graph edges
livekitobjectLiveKit credentials (falls back to env vars)
apiKeysobjectProvider API keys (merged with env var fallbacks)

Response

{
  "token": "eyJ...",
  "roomName": "voiceblox-1234567890-abc",
  "serverUrl": "wss://your-project.livekit.cloud"
}
FieldTypeDescription
tokenstringLiveKit JWT access token for the user
roomNamestringUnique room identifier
serverUrlstringLiveKit WebSocket URL

DELETE — End session

DELETE /api/agent-session

Request

{ "roomName": "voiceblox-1234567890-abc" }
Cleans up the agent and LiveKit room. Returns { "ok": true }.