big-school-62939
03/09/2026, 1:12 PMtall-airline-16756
03/09/2026, 1:13 PMtall-airline-16756
03/09/2026, 1:13 PMidentity (for example, agent-bot-1).
◦ Grant it permission to join the specific room (e.g., roomJoin: true and the room name).
1. Return that agent token to whatever process will run the agent (the agent itself or the service that spawns the agent).
2. Have the agent connect to the room using that token independently from the Unity client participant.
Why: each token represents a specific participant identity. Reusing a participant’s token would attempt to authenticate as that same identity, which is not correct for a separate agent and can cause identity/permission conflicts.
If you’d like, I can:
• Show a short server-side token-generation snippet in the language you use.
• Walk through how to wire this into your Unity client and the agent process. Which language is your backend written in? Sources: server-sdk-kotlin | livekit/livekit_composite | DeepWiki | client-sdk-unity | livekit/livekit_composite | DeepWikibig-school-62939
03/09/2026, 1:40 PMtall-airline-16756
03/09/2026, 1:40 PM/api/sandbox/connection-details endpoint to get a token for creating an agent in an existing room.
Short answer: the sandbox endpoint is for quick participant tokens (demo clients) and is not the right way to create an agent. You should generate a server-signed Access Token for the agent using your LiveKit API Key and Secret (via a LiveKit server SDK), or dispatch the agent from a server-generated participant token.
What to do next (two common approaches):
1) Generate an agent token directly (recommended for agents)
• On your secure backend, use a LiveKit server SDK to build an Access Token for the agent.
• Set a unique identity for the agent and include a grant that allows joining the specific room (e.g., roomJoin: true, room: "existing-room-name").
• Return that JWT to the agent process; the agent connects to the room with that token independently from Unity.
2) Dispatch an agent when a user joins (alternative)
• Instead of separately issuing an agent token, you can include an agent dispatch configuration in the participant’s server-generated token so the agent is automatically dispatched to the room when the participant connects.
• This dispatch configuration is created server-side when you generate the participant token.
If you want, I can:
• Show a short server-side example in the language you use (Node.js, Python, Go, or Kotlin).
• Help you pick between direct agent tokens vs. dispatch based on how your agent runs (backend process vs. auto-started agent).
Which backend language do you use for token generation?
Sources: server-sdk-js | livekit/livekit_composite | DeepWiki | Agent dispatch | LiveKit Documentation