### sbx.desktop.start Source: https://instabox.sh/docs/sdk Starts the desktop environment. Resolves once the desktop runs, leaving a running one as is. On templates without the desktop, it installs it first (about half a minute, once). ```APIDOC ## sbx.desktop.start ### Description Starts the desktop environment. Resolves once the desktop runs, leaving a running one as is. On templates without the desktop, it installs it first (about half a minute, once). ### Method start ### Signature start(opts?: { width?: number; height?: number }): Promise ### Parameters - **opts.width** (number) - Optional - Screen width in pixels. Range: 800 to 2560. Default: 1280. - **opts.height** (number) - Optional - Screen height in pixels. Range: 600 to 1600. Default: 800. ### Returns - Promise - The desktop status, including `installed`, `running`, and `width` and `height` while running. ### Notes - The desktop runs on X display `:1` (DESKTOP_DISPLAY). ``` -------------------------------- ### port setup Source: https://instabox.sh/docs/cli Installs the instabox-port command in the machine. ```APIDOC ## port setup ### Description Installs the instabox-port command in the machine. ### Syntax ``` port setup ``` ### Parameters - **id-or-name** (string) - Required - The machine identifier or name. ``` -------------------------------- ### One-command setup with npx instabox@latest sh Source: https://instabox.sh/docs/start Run this command to sign in through the browser, start a new machine, install the instabox CLI and agent skills, and open a shell over SSH. ```bash npx instabox@latest sh ``` -------------------------------- ### Example: Get Metrics and Usage Source: https://instabox.sh/docs/sdk Example showing how to get the last 15 minutes of CPU and memory metrics, and usage since the start of October (UTC). Logs runningSeconds and vcpuSeconds. ```typescript // the last 15 minutes of CPU and memory const samples = await sbx.getMetrics({ since: new Date(Date.now() - 15 * 60_000), }) // what it used since the start of October (UTC) const usage = await Sandbox.getUsage(sbx.sandboxId, { from: new Date('2026-10-01T00:00:00Z'), }) console.log(usage.runningSeconds, usage.vcpuSeconds) ``` -------------------------------- ### SDK: Start desktop and perform actions Source: https://instabox.sh/docs/desktop Initializes an agent-browser sandbox, starts the desktop, and demonstrates core actions: open a URL, take a screenshot, click, press keys, type text, and scroll. `start()` is safe to call again and leaves a running desktop alone. ```javascript import { Sandbox } from '@insforge/instabox-sdk' const sbx = await Sandbox.create('agent-browser') await sbx.desktop.start({ width: 1280, height: 800 }) await sbx.desktop.open('https://example.com') // opens the browser const png = await sbx.desktop.screenshot() // PNG bytes, e.g. for a vision model await sbx.desktop.click(640, 400) // { button: 'right' }, { double: true } await sbx.desktop.press(['ctrl', 'l']) // a key or a chord await sbx.desktop.type('instabox.sh') // any text, quotes and unicode included await sbx.desktop.press('Enter') await sbx.desktop.scroll({ direction: 'down', amount: 5 }) ``` -------------------------------- ### GET /v1/templates Source: https://instabox.sh/docs/api/account Lists the templates that a machine can start from, including the software each one has. ```APIDOC ## GET /v1/templates ### Description Lists the templates that a machine can start from, including the software each one has. ### Method GET ### Endpoint /v1/templates ### Request Example curl https://api.instabox.sh/v1/templates -H "X-API-Key: $INSTABOX_API_KEY" ### Response #### Success Response (200) - **templates** (array) - List of templates. - **id** (string) - Template identifier. - **version** (string) - Template version. - **description** (string) - Description of the template. - **arch** (string) - Architecture (e.g., x86_64). - **defaultSpec** (object) - Default specification with vcpus, memMiB, persistentDiskGiB. #### Response Example { "templates": [ { "id": "universal", "version": "2026-10-13.10", "description": "dev plus Docker, Python (uv), Go and Rust", "arch": "x86_64", "defaultSpec": { "vcpus": 4, "memMiB": 8192, "persistentDiskGiB": 20 }, … } ] } ``` -------------------------------- ### HTTP: Start desktop Source: https://instabox.sh/docs/desktop Starts the desktop session via HTTP API. ```APIDOC ## POST /v1/machines/{machine_id}/desktop ### Description Starts the desktop session with specified dimensions. ### Method POST ### Endpoint `/v1/machines/{machine_id}/desktop` ### Parameters #### Path Parameters - **machine_id** (string) - Required - The machine ID. #### Request Body - **action** (string) - Required - Must be "start". - **width** (number) - Required - Width of the desktop. - **height** (number) - Required - Height of the desktop. ### Request Example ```json { "action": "start", "width": 1280, "height": 800 } ``` ### Response No response body specified. ``` -------------------------------- ### SDK: Start desktop Source: https://instabox.sh/docs/desktop Starts the desktop session with specified dimensions. Safe to call again; leaves a running desktop alone. ```APIDOC ## SDK: Start desktop ### Description Starts the desktop session with specified width and height. Safe to call again; leaves a running desktop alone. ### Method SDK Method ### Endpoint `sbx.desktop.start({ width, height })` ### Parameters - **width** (number) - Required - Width of the desktop in pixels. - **height** (number) - Required - Height of the desktop in pixels. ### Request Example ```javascript await sbx.desktop.start({ width: 1280, height: 800 }) ``` ### Response No return value. ``` -------------------------------- ### Start machine response (202 Accepted) Source: https://instabox.sh/docs/api/lifecycle Example JSON response for the start operation, showing the operation ID, machine ID, type, state, and timestamps. ```json { "id": "op_7xk2mq4tz5rbw3vn6pd2hs4jye", "machineId": "m_agqteugyy5px6hzeadbh4ldjo4", "type": "start", "state": "queued", "error": null, "createdAt": "2026-10-13T09:12:04Z", "updatedAt": "2026-10-13T09:12:04Z" } ``` -------------------------------- ### Step-by-step installation and login Source: https://instabox.sh/docs/start Install the CLI, sign in through the browser, create a machine named 'dev' with the universal template, and SSH into it. On a computer without a browser, use `instabox login --device`. ```bash curl -fsSL https://api.instabox.sh/install.sh | sh # install the CLI instabox login # sign in through the browser instabox create --name dev --template universal instabox ssh dev ``` -------------------------------- ### Install CLI and use with API key Source: https://instabox.sh/docs/keys-sdk Installs the CLI and shows create, exec, ssh, and rm commands using the API key from the environment. ```bash curl -fsSL https://api.instabox.sh/install.sh | sh instabox create --name box --template herdr instabox exec box -- uname -a instabox ssh box instabox rm box ``` -------------------------------- ### Get a machine response (200 OK) Source: https://instabox.sh/docs/api/machines Example response for the get machine endpoint, showing full machine details. ```json { "id": "m_agqteugyy5px6hzeadbh4ldjo4", "name": "dev", "state": "running", "desiredState": "running", "revision": 3, "operationId": null, "template": { "id": "universal", "version": "2026-10-13.10", "digest": "sha256:9f2c…" }, "spec": { "vcpus": 4, "memMiB": 8192, "persistentDiskGiB": 20 }, "storage": { "sizeGiB": 20, "mountPath": "/data", "persistent": true, "synced": true }, "runtime": { "ready": true }, "autoSuspendAfterSeconds": 1800, "metadata": { "task": "review" }, "guestUser": "alice", "createdAt": "2026-10-13T09:12:04Z", "updatedAt": "2026-10-13T09:12:31Z" } ``` -------------------------------- ### Install mosh on snapshots made before mosh was added Source: https://instabox.sh/docs/ssh Install mosh on the machine itself for snapshots created before mosh was added. Run this once on the machine. ```bash sudo apt install mosh ``` -------------------------------- ### sbx.desktop.start() Source: https://instabox.sh/docs/integrate Starts the desktop. Safe to call again. ```APIDOC ## sbx.desktop.start() ### Description Starts the desktop. Safe to call again. ### Method start ### Parameters None ### Request Example ```javascript await sbx.desktop.start() ``` ### Response #### Success Response No return value documented. ``` -------------------------------- ### Get usage and limits - 200 OK response Source: https://instabox.sh/docs/api/account Example JSON response from /v1/usage showing current usage metrics and limits. ```json { "machines": 2, "snapshots": 1, "storedBytes": 6442450944, "computedAt": "2026-10-13T10:00:00Z", "limits": { "maxMachines": 5, "maxSnapshots": 10, "maxStoredGiB": 200, … }, … } ``` -------------------------------- ### Control the desktop with sbx.desktop Source: https://instabox.sh/docs/integrate Starts the desktop, creates a view-only stream URL, opens a URL, takes screenshots, simulates clicks and typing, and revokes stream URLs. Safe to call start() again. Revoking closes open viewers within seconds. ```javascript // starts the desktop; safe to call again await sbx.desktop.start() // Let people watch it: a link to one machine's desktop, // for a new tab or an