Create Realtime Chat Connection
Create a short-lived realtime chat WebSocket connection token and return a ready-to-use wsUrl.
Use this endpoint when your backend should validate the license, avatar, domain/IP restrictions, and optional maximum call duration before opening the realtime WebSocket. The returned wsUrl points to /wss/v2/realtime-chat?token=... and can be used directly by the client.
Request rule: pass exactly one of avatarId or name. Do not pass both. Do not send model or voice in this token request; use the existing realtime session configuration flow after the WebSocket connects for session-level settings.
avatarId: use a trained avatar ID for precise lookupname: use an avatar or system character name
durationSeconds is optional. When provided, it limits the maximum realtime call duration for the generated connection.
Do not send model or voice in this token request. Continue using the existing realtime session configuration flow after the WebSocket connects for session-level settings.
The response includes wsUrl, which can be passed directly to new WebSocket(wsUrl). The generated URL connects to /wss/v2/realtime-chat with a short-lived token.
wsUrl, or connect directly to /wss/v2/realtime-chat with license and either name or avatarId in the query string.Authorizations
NavTalk API license key (e.g. sk_navtalk_...)
Body
- Option 1
- Option 2
Request body for creating a realtime chat WebSocket connection token. Pass exactly one of avatarId or name. Do not include model or voice in this token request.
Avatar ID to connect to. Use this for precise avatar lookup.
"8914367e-3892-4572-b345-e5023b0f03ec"
Avatar or character name to connect to. If multiple avatars share this name, the service selects the first matching user avatar, then falls back to a system avatar.
"navtalk.Leo"
Optional maximum call duration in seconds. Must be greater than 0 when provided.
x >= 1600