> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tilion.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Watch a session

> Create a short-lived URL for the browser's live viewer.

Request a viewer token for a [running session](https://docs.tilion.dev/guides/create-browser.md). Set `TILION_API_KEY` and `TILION_SESSION_ID` first.

```python Python theme={"dark"}
import os
import requests

base = "https://back.tilion.dev"
sid = os.environ["TILION_SESSION_ID"]
response = requests.post(
    f"{base}/v1/session/{sid}/view-token",
    headers={"Authorization": f"Bearer {os.environ['TILION_API_KEY']}"}, timeout=30,
)
response.raise_for_status()
print(base + response.json()["live_view_url"])
```

```javascript Node.js theme={"dark"}
const base = "https://back.tilion.dev";
const sid = process.env.TILION_SESSION_ID;
const response = await fetch(`${base}/v1/session/${sid}/view-token`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.TILION_API_KEY}` },
  signal: AbortSignal.timeout(30_000),
});
if (!response.ok) throw new Error(await response.text());
console.log(base + (await response.json()).live_view_url);
```

```bash curl theme={"dark"}
# Requires jq. Open the printed URL in a browser.
curl --fail-with-body --silent --show-error -X POST \
  "https://back.tilion.dev/v1/session/$TILION_SESSION_ID/view-token" \
  -H "Authorization: Bearer $TILION_API_KEY" \
  | jq -r '"https://back.tilion.dev" + .live_view_url'
```

The response contains `token`, `expires_in`, and `live_view_url`. The viewer path includes its token, so opening it does not require an Authorization header.

> [!NOTE]
>
> Viewer tokens expire after 1,800 seconds. Treat the URL as a credential and request a new token when it expires.

## View the full desktop

Create a session with `full_browser: true`, then request `POST /v1/session/{id}/vnc-token`. Check the creation response's `full_browser` field to confirm that a visible desktop was provided.

Disconnect the VNC client before sending REST drive requests. Closing the viewer does not delete the session.

The [live-view reference](https://docs.tilion.dev/sessions/live-view.md) includes VNC response fields, WebSocket streams, and recording endpoints.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.