Get a short-lived token for opening the chat socket as yourself

POST /Platform/chat/stream-token

Get a short-lived token for opening the chat socket as yourself.

For a browser host that holds an access key but is not on a Hilus origin (the Chrome extension's side panel), so it cannot use the session cookie and must not put the key in a socket URL, which access logs record. Call this with the key in the Authorization header, then open the chat stream socket with ?token= set to the result. The token opens that socket only, as you and in your organization, within a minute; an open socket is not cut off when it expires, and each new connection needs a new token. The chat keeps the key's limits: a key limited to some routes opens the socket only if they include it, and its agent can use only those routes.

Body parameters

Returns

ChatStreamToken

Example request

curl -X POST "https://api.hilus.ai/Platform/chat/stream-token" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'