API reference

Desktop control endpoints proxy authenticated commands to the agent inside the Computer. All of them require the Computer to be running; a stopped or provisioning Computer returns 409 COMPUTER_NOT_RUNNING.

Base path: /api/v1/computers/{id}/desktop.

Observation

MethodPathPurpose
GET/screenshotFull desktop as PNG (Content-Type: image/png)
POST/screenshot/regionRectangular region as PNG; body { x, y, width, height }
GET/windowsOpen windows: id, title, class, x, y, width, height, focused
GET/cursorCursor position { x, y } in screen pixels
GET/screen-sizeDisplay resolution { width, height }
GET/environmentDesktop environment name and version (for example xfce4)
GET/accessibility-treeAT-SPI element tree as nested JSON
GET/window-stateScreenshot and accessibility tree in one round trip

GET /desktop/window-state

Runs the screenshot and the accessibility tree in parallel and returns them together from the same moment, so an agent pays one round trip instead of two.

{
  "data": {
    "screenshot": {
      "content_type": "image/png",
      "encoding": "base64",
      "bytes": 214733,
      "data": "iVBORw0KGgo..."
    },
    "accessibility_tree": { "role": "frame", "name": "Firefox", "children": [ ] },
    "captured_at": "2026-10-10T12:00:00.000000Z"
  }
}

A part that fails does not fail the request: it is null and named under an errors object, so the caller can still use the other half. Only when both parts fail is the request a 502 AGENT_UNAVAILABLE.

Mouse

MethodPathBody
POST/clickx, y, button (left|right|middle, default left)
POST/double-clickx, y
POST/movex, y (move the pointer, no click)
POST/dragfrom_x, from_y, to_x, to_y
POST/mouse-downx, y, button (default left)
POST/mouse-upx, y, button (default left)
POST/scrollx, y, direction (up|down|left|right), clicks

mouse-down / mouse-up hold and release a button with no click between them, so you can move the pointer mid-drag (move then mouse-up) or implement a long press.

Keyboard

MethodPathBody
POST/typetext, optional delay (ms between keys)
POST/keykey - a single key or a + chord, for example Return or ctrl+a
POST/hotkeykeys - a simultaneous combo, for example ["ctrl", "shift", "t"]
POST/key-downkey - press and hold
POST/key-upkey - release

Key names follow the X11 keysym convention: Return, Tab, BackSpace, Delete, Home, End, Page_Up, Page_Down, Up, Down, Left, Right, F1-F12, and the modifiers super, ctrl, alt, shift. type types literal text and does not interpret key names; use key for those.

Clipboard, windows, and desktop

MethodPathBody
GET/clipboardRead clipboard text
POST/clipboardtext - write clipboard text
POST/window/focuswindow_id
POST/launchcommand - launch an app, runs in the background
GET/window/{window_id}/sizeRead a window’s { width, height }
GET/window/{window_id}/positionRead a window’s { x, y }
POST/window/{window_id}/resizewidth, height
POST/window/{window_id}/movex, y
POST/window/{window_id}/maximize-
POST/window/{window_id}/minimize-
POST/window/{window_id}/close-
POST/wallpaperpath - set the background from a file inside the VM

Timing

MethodPathBody
POST/waitseconds - sleep inside the Computer, capped at 30, to let UI animations settle
MethodPathPurpose
GET/api/v1/computers/{id}/screenshotAlias for the full-desktop screenshot
GET/api/v1/computers/{id}/urlsSigned desktop, VNC, terminal, and entry URLs
POST/api/v1/computers/{id}/stream-tokenMint a short-lived viewer stream token
GET/api/v1/computers/{id}/vnc-credentialsVNC credentials for the desktop
GET/api/v1/computers/{id}/viewer-passwordRead the raw external viewer password
POST/api/v1/computers/{id}/viewer-password/rotateRotate the raw external viewer password

Coordinates

Coordinates are screen pixels with the origin at the top-left, matching what screen-size and cursor report. A vision model may be shown a scaled-down screenshot; map its output back to screen pixels before sending an action.

Errors

StatusCodeCause
409COMPUTER_NOT_RUNNINGThe Computer is stopped, provisioning, or recovering
502AGENT_UNAVAILABLEThe agent inside the Computer did not answer
429-Rate limited; honor X-RateLimit-* and Retry-After

See also: Desktop API for the field-by-field request and response shapes.

Was this page helpful?