Skip to main content
Mints a short-lived client secret that a browser offers when it opens WS /v1/ws or WS /v1/ws/systemone. Call it from your server with your API key, and send only value to the page. The route is served beside the sockets, so it is not in the OpenAPI schema.
The request mints a secret for the caller of the API key that is good for 600 seconds, and returns 200 with the secret:

Request body

The body is optional. With no body, the secret is good for 600 seconds.

expires_after

object, optional, default: 600 seconds from now.

Response

Open a socket with the secret

Offer the secret as a WebSocket subprotocol, beside vlmrun.realtime:
Browser
The page opens a frames socket as the caller who minted the secret. The server accepts the vlmrun.realtime subprotocol and never echoes the secret. A server-side client can also send the secret as Authorization: Bearer ek_....
  • The secret is its caller. A socket opened with it has the plan, session caps, and billing of the API key that minted it.
  • One secret, many sockets. A secret opens any number of sockets until expires_at, so a page can reconnect on it. The expiry bounds the upgrade only: a socket opened in time runs its full session.
  • Only a client secret goes in the subprotocol. The Sec-WebSocket-Protocol header can be logged by a proxy, so an API key or a JWT in vlmrun.bearer.* is a 401. The one exception is the anonymous key on /v1/ws, vlmrun.bearer.vlmrun. See Anonymous sessions.
  • Expired or unknown secrets are a 401 at the upgrade. Mint another one.

Errors

Webcam from the Browser

A page that mints a secret on your server and streams the camera to the Gateway.

WS /v1/ws reference

Every event on the frames socket.