Discussions

Ask a Question
Back to all

Seeking clarification on real-time termination latency for LiveAvatar sessions

Hi HeyGen Team & Community,


I am building an application that requires a strict single-session-per-user policy. If a user logs in and starts a LiveAvatar session while an existing one is active (e.g., from another device), I want my backend to immediately kill the first session using the /sessions/stop endpoint before initiating a new /sesssions/start request.


My primary concern is the speed of termination:
When I call streaming.stop, does the first user's WebRTC stream and avatar session end immediately (sub-second), or is there a propagation delay where the avatar might remain active for a few seconds?
If I call sessions/start immediately after a successful 200 response from sessions/stop, is there any risk of hitting a "concurrent limit reached" error because the previous session hasn't fully cleared from the server-side state yet?
Has anyone implemented this "kick-off" logic successfully, and are there any recommended delays I should add between these calls to ensure a smooth transition?


Best regards,
Akshay K