Skip to main content
Live view streams a sandbox to a browser: its terminal, or its desktop. Your backend mints a short-lived viewer token with your API key, and your page shows the returned embed URL in an iframe. Many people can watch the same sandbox; the sandbox serves one stream per view, whatever the number of viewers. 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

The embed URL looks like 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, with postMessage. Answer it with a fresh token from your backend:
The viewer reconnects on its own after network drops. It stops for good when the token is revoked, the sandbox is gone, or the token does not allow the channel.

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 with display: 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

For desktop, 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, and 204 No Content otherwise:
thumbnail.sh
The sandbox grabs frames only while someone asks for them, and every viewer shares the same frames. Send 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.