how can we know how many agent sessions are runnin...
# ask-ai
b
how can we know how many agent sessions are running is there an api for this
t
Thanks for reaching out, Mohammed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd be happy to help you with checking the number of agent sessions running in LiveKit using the Analytics API. This API is a great tool that lets you list active sessions in your project, including agent sessions, as long as you're using LiveKit Cloud with a Scale plan or higher. Here’s a simple way to get started: 1. Generate an Access Token: First, create a token with the
roomList
grant using a server-side SDK. 2. List Sessions: Then, make a request to the Analytics API endpoint to retrieve active sessions. You’ll get useful details about each session, like session ID, room, and connected participants. 3. Identify Agent Sessions: Finally, filter through the session data to spot those involving agents, based on participant identities or metadata. While there isn’t a specific "agent session count" endpoint, you can still find this info by analyzing the session and room data the API provides. If you want to dive deeper, the Analytics API documentation is a fantastic resource. Just a quick note: The Analytics API is available for LiveKit Cloud customers on a Scale plan or higher. If you’re on a different plan or self-hosting, you might want to use dashboard visibility or set up custom telemetry with OpenTelemetry to keep track of agent sessions. Sources: Logs, metrics, and telemetry | LiveKit Docs | Analytics API | LiveKit Docs | Quotas and limits | LiveKit Docs | Deploying to production | LiveKit Docs | Deploying to custom environments | LiveKit Docs