Watch the screen live
A WebSocket upgrade (RFC 6455) carrying the screen as H.264 for WebCodecs.
Not available yet The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet.
A WebSocket upgrade (RFC 6455) carrying the screen as H.264 for WebCodecs. Pod sends text frames holding one JSON message each (ScreenStreamServerMessage: start first and again when the settings change, gap when pictures were lost, takeover when the person's takeover ends elsewhere, end before it closes with 1000) and binary frames holding one picture each: byte 0 the flags (bit 0, a key frame), bytes 1 to 8 the capture time in microseconds (big-endian), the rest the picture in Annex B, as the screen worker makes it. The first picture after start is a key frame, so a late watcher decodes at once. A still screen sends nothing. On a stream opened with a takeover ticket the client sends ScreenStreamClientMessage: input with actions of ScreenAction and an idempotency key of its own, so a resend types nothing twice. A watch stream refuses input with an error message and stays open. Two ways in, as on a command's stream: Authorization from a client that can send headers (watch only), or a ticket from createScreenStreamTicket or a watch link, offered beside pod.stream.v1 in Sec-WebSocket-Protocol, never in the address. Every well-formed ticket an upgrade offers is spent first, and every refusal of a ticket is the same unauthorized (createExecStreamTicket's rules). Tickets are never logged.
A key with the screen:read scope.
Request
A WebSocket. Open the stream_url the command's answer gives, with your key in Authorization; a browser opens it with a stream ticket instead. The SDKs open it for you.
Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
sandbox_id | path | string | Yes | |
Sec-WebSocket-Protocol | header | string | No | With a stream ticket: pod.stream.v1, pod_ticket_…. Without one, pod.stream.v1 may be offered and is then selected. |
Errors
The refusals this call is known for: invalid, not_found, not_ready, in_other_cell. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.
In the SDKs
| Client | Call |
|---|---|
| TypeScript | sandbox.screen.watch() |
| Python | sandbox.screen.watch() |