Is there an API to see what workers are active? an...
# ask-ai
f
Is there an API to see what workers are active? and get the agent_name for the workers? This is with regards to generating a token, which would automatically dispatch an agent to the room when the user with the token enters the room. I realised that I would get the token even when the worker agent is not active, or there is no such agent_name. Is there an API exposed to get these details other than the cloud console?
t
Thanks for reaching out, Mok. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Just a heads-up: LiveKit doesn’t offer a direct public API to check which workers are active or to validate an
agent_name
. Behind the scenes, though, it uses an internal
CheckEnabled
RPC service that pulls a list of active
agent_name
values along with their job types. This is part of the internal protocol and isn’t available as a public endpoint. When worker agents come online, they register themselves with the server using a
RegisterWorkerRequest
, which includes their
agent_name
. If that registration goes through, it means the agent is active. Also, starting with LiveKit v1.8.0, there’s an API for checking agent worker job counts—this might help you get some operational insights, though info on this API is a bit limited right now. If you want, I’m here to help you navigate or set up any of this—just let me know! Sources: pkg/agent/client.go | Worker | LiveKit Agents | CHANGELOG.md | livekit-protocol/livekit/protocol/agent.py | livekit/livekit_agent.pb.go