Embedding & Streaming
To show a live desktop session in your end-user’s browser, embed MIOSA’s desktop stream. Use this for “watch the AI work” UI, manual takeover, internal support tools, and kiosk-style apps.
Access model
There are three ways to enter a Computer desktop. They are intentionally different because they protect different surfaces.
| Access path | Who uses it | Authentication |
|---|---|---|
| Platform desktop button | Signed-in MIOSA users | Normal MIOSA session and workspace permissions |
| Embedded stream ticket | Your app backend and frontend | Your backend mints a short-lived URL with the MIOSA API key |
| Raw external desktop URL | Emergency or direct viewer access | Viewer password gate |
Use embedding for your own UI.
Use viewer_password() / rotate_viewer_password() only for raw external desktop viewer links.
Authenticated platform desktop links and stream tickets do not need the raw viewer password.
Quick example
The flow
1. Your backend asks MIOSA for signed Computer URLs or a stream token for a running computer
2. MIOSA returns a short-lived desktop URL or token
3. Your frontend renders an iframe with that URL
4. The user sees the live desktop; keyboard/mouse input is forwarded into the VM Operator workflow
Most production Computer flows look like this:
The Computer is the stateful machine. The stream ticket is only temporary access to that machine. If the browser tab closes, the Computer keeps its state until you stop or delete it.
Get an embed URL
Response:
{
"desktop_url": "https://agent-1.computer.miosa.ai/desktop/index.html?auth=...",
"desktop_entry_url": "https://agent-1.computer.miosa.ai/desktop/index.html",
"vnc_url": "https://agent-1.computer.miosa.ai/desktop/index.html?auth=...",
"ws_url": "wss://agent-1.computer.miosa.ai/vnc/websockify?auth=...",
"terminal_url": "wss://agent-1.computer.miosa.ai/ws/terminal/cmp_xxx",
"token": "miosa_stream_...",
"expires_at": 1783000000,
"computer_id": "cmp_xxx"
} desktop_url is what you embed. token is returned in case you need to construct your own stream URL or proxy the stream through a custom gateway.
Embed
MIOSA handles pixel streaming and input forwarding inside the iframe. The user clicks or types in the iframe and those events go to the desktop.
What’s streamed (Voxl 60fps)
- 60fps low-latency pixels - MIOSA’s Voxl desktop stream delivers crisp 60fps desktop video tuned for text, code editors, and browser UIs.
- Cursor position - overlay rendered client-side.
- Audio - optional, off by default. Pass
?audio=1if your app needs it. - Clipboard - bidirectional in interactive mode, gated by the iframe’s
allow="clipboard-read; clipboard-write".
Watch-only vs interactive take-over
Mint a server-enforced view-only token by passing view_only: true on POST /api/v1/computers/{id}/stream-token (or ?view_only=1 when minting URLs):
# Watch-only token: keyboard, mouse, and clipboard input are dropped at the relay
curl -X POST "https://api.miosa.ai/api/v1/computers/${COMPUTER_ID}/stream-token" \
-H "Authorization: Bearer $MIOSA_API_KEY" -H "Content-Type: application/json" \
-d '{"view_only":true}'
# Interactive take-over token: full mouse, keyboard, and clipboard control
curl -X POST "https://api.miosa.ai/api/v1/computers/${COMPUTER_ID}/stream-token" \
-H "Authorization: Bearer $MIOSA_API_KEY" -H "Content-Type: application/json" \
-d '{"view_only":false}' view_onlyis bound inside the minted token on the server and cannot be stripped client-side; view-only tokens also reject terminal and event relays.- To hand off from watch-only to human take-over, pause the agent loop, mint an interactive token (
view_only: false), and swap the iframesrcwithout losing window state. - Tokens minted with a machine session key are single-use (admitting one desktop connection).
Bandwidth
Default codec / bitrate is tuned for typical desktop content, usually about 500 Kbps to 2 Mbps. For high-motion content, such as video playback inside the VM, the codec adapts but expect higher bitrate. The stream gateway is geo-routed to the user’s nearest region for lower latency.
Lifetime
Stream URLs are short-lived.
The default lifetime is 1 hour, and max lifetime is plan-dependent.
When a token expires, the stream disconnects.
Your frontend should watch expires_at and re-mint before that.
Multiple stream URLs per computer are fine. Multiple browsers can watch the same desktop simultaneously. They all see the same pixels.
Custom domains / branded streaming
White-label customers can configure a branded stream domain so end users see your brand in the iframe URL. The DNS and TLS flow follows the same contract as Deployment Domains, with a different routing target. Contact support to set up branded streaming.
White-label desktops
Computers support per-tenant desktop branding. After starting a computer, push a wallpaper and apply it with two SDK calls. The wallpaper persists across stop/start cycles because it is stored in the VM’s snapshotted filesystem.
Strict per-tenant CSP (frame-ancestors)
The stream gateway enforces Content-Security-Policy: frame-ancestors per tenant so only your approved origins can frame your users’ desktops:
- Default:
*.miosa.app,*.miosa.ai, and local development origins. - White-label production: register your exact platform origins (
https://app.yourdomain.com) in tenant branding/white-label config so the gateway emits strict per-tenantframe-ancestorsheaders and hides MIOSA branding. - Combine strict
frame-ancestorswith short-lived stream tokens andview_onlygating to prevent unauthorized framing or clickjacking.
Audit
Each stream URL issuance emits an audit event with:
- The computer ID
- The token prefix
- Issuing API key
- External attribution
If a token is leaked, rotate the user session or stop the Computer while you investigate. Stream tokens are short-lived by default.
See also
- Overview - what you’re embedding
- Computer use - programmatic control of the same desktop
- Browser Tokens - analogous pattern for sandbox previews