thumb is not a get_live_view_url mode — mint it with the SDK’s token(channels=["thumb"]), or skip tokens entirely and poll GET /v1/sandboxes/{id}/thumbnail below.
Scopes: view watches; control also sends keystrokes, mouse and resize. Tokens last 30 to 600 seconds (default 600).
Mint a token
https://stream.compute.anonalabs.com/embed/v1/<id>?mode=terminal#t=<token>. The token is in the URL fragment, which browsers never send to a server, so it does not end up in logs.
Embed it
Mint the token on your server (never ship your API key to a browser) and put the URL in an iframe:Keep a long session alive
A token expires after at most 10 minutes. The embed asks its host page for a new one shortly before that, withpostMessage. Answer it with a fresh token from your backend:
When nobody is looking
The embed closes its stream when nobody can see it for 10 seconds: the tab is in the background, the window is minimised, or the iframe is scrolled out of view or hidden withdisplay: none. It reconnects on its own as soon as it is visible again, and asks for a fresh token first if the old one expired in the meantime. Your page needs no code for this. When it closes, the embed sends a state message with state: "hidden". This does not pause the sandbox; only the stream stops.
A desktop comes back as a new session showing the current screen. A terminal comes back to the same shell, with whatever it was running.
Desktop quality
Fordesktop, add quality to the embed URL’s query string, before the #:
quality changes how the screen is compressed for that one viewer. It does not change the resolution: every viewer sees the full desktop, scaled to fit the iframe.
Thumbnails
For lists and dashboards, fetch the latest thumbnail directly. It is a WebP while the sandbox has a screen or a Chrome page to show, and204 No Content otherwise:
thumbnail.sh
If-None-Match with the last ETag to get 304 when nothing changed.
Who may mint
A key limited to certain sandboxes can mint only for those. A sandbox of another organization answers
404. The dashboard’s sandbox page has the same live view built in.