Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Act a lease

Performs computer actions on a DESKTOP, BROWSER, or ANDROID lease, in order, and returns each action's result and, when `screenshot` is set,…

Performs computer actions on a DESKTOP, BROWSER, or ANDROID lease, in order, and returns each action's result and, when screenshot is set, the screenshot taken after the last action. The actions are the Anthropic computer tool's and OpenAI computer use's, one-to-one. Refused CONTROL_HELD_BY_HUMAN while a human holds control.

  • Path POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease:act
  • Scope sandboxes:exec
  • Effect write — a successful call changes state.
  • Collection leases

#Request

FieldTypeWhat it is
namestringThe name of the lease. Required.
actionsComputerAction[]The actions, performed in order; at most 64. An empty list with screenshot set only takes a screenshot.
screenshotScreenshotOptionsTake a screenshot after the last action and return it.
lease_generationint64Refuse STALE_GENERATION unless the lease is at this generation; 0 skips the check.
control_epochint64Act under this AGENT control epoch; 0 acts only while nobody holds control.

#ComputerAction

FieldTypeWhat it is
take_screenshotScreenshotActionCapture the display (Anthropic screenshot, OpenAI screenshot). One of the action group.
zoomZoomActionCapture a region at full resolution (Anthropic zoom). One of the action group.
movePointerMoveMove the pointer (Anthropic mouse_move, OpenAI move). One of the action group.
clickClickActionClick (Anthropic left_click, right_click, middle_click, double_click, triple_click; OpenAI click, double_click; Android tap). One of the action group.
mouse_downButtonActionPress a button without releasing it (Anthropic left_mouse_down). One of the action group.
mouse_upButtonActionRelease a button (Anthropic left_mouse_up). One of the action group.
dragDragActionPress, move along a path, release (Anthropic left_click_drag, OpenAI drag; Android swipe). One of the action group.
scrollScrollActionScroll (Anthropic scroll, OpenAI scroll). One of the action group.
keyKeyActionPress a key combination (Anthropic key, OpenAI keypress; Android key events). One of the action group.
hold_keyHoldKeyActionHold a key combination for a duration (Anthropic hold_key). One of the action group.
typeTypeActionType text (Anthropic type, OpenAI type). One of the action group.
cursor_positionCursorPositionActionReport the pointer position (Anthropic cursor_position). One of the action group.
waitWaitActionWait (Anthropic wait, OpenAI wait). One of the action group.

#ScreenshotOptions

FieldTypeWhat it is
formatImageFormatDefault PNG. One of png, jpeg, webp.
qualityint32JPEG and WebP quality 1 to 100; default 80.
max_widthint32Downscale to at most this width, keeping the aspect ratio; 0 keeps the display size.
settledurationWait this long after the last action before capturing, so the screen settles; default 300 ms, at most 5 seconds.

#ScreenshotAction

FieldTypeWhat it is
optionsScreenshotOptionsHow to encode it.

#ZoomAction

FieldTypeWhat it is
regionRegionThe region, in display pixels. Required.
optionsScreenshotOptionsHow to encode it; the region is scaled to options.max_width when set.

#PointerMove

FieldTypeWhat it is
positionPointWhere to. Required.

#ClickAction

FieldTypeWhat it is
positionPointWhere; unset clicks at the current pointer position.
buttonMouseButtonDefault LEFT. One of left, right, middle, back, forward.
countint321 (default), 2 (double), or 3 (triple).
modifiersstring[]Keys held during the click, xdotool names (shift, ctrl, alt, super).

#ButtonAction

FieldTypeWhat it is
positionPointWhere; unset acts at the current pointer position.
buttonMouseButtonDefault LEFT. One of left, right, middle, back, forward.

#DragAction

FieldTypeWhat it is
pathPoint[]At least two points. Required.
buttonMouseButtonDefault LEFT. One of left, right, middle, back, forward.
modifiersstring[]Keys held during the drag, xdotool names.
durationdurationTotal time of the move; default 300 ms (Android swipe duration).

#ScrollAction

FieldTypeWhat it is
positionPointWhere; unset scrolls at the current pointer position.
delta_xint32Horizontal amount in unit.
delta_yint32Vertical amount in unit.
unitScrollUnitDefault CLICKS (wheel notches, Anthropic scroll_amount); PIXELS (OpenAI scroll_x/scroll_y) are converted at 100 pixels per notch on desktops. One of clicks, pixels.
modifiersstring[]Keys held during the scroll, xdotool names.

#KeyAction

FieldTypeWhat it is
combostringThe combination. Required.
repeatint32Press it this many times; default 1.

#HoldKeyAction

FieldTypeWhat it is
combostringThe combination, xdotool syntax. Required.
durationdurationHow long; at most 10 seconds. Required.

#TypeAction

FieldTypeWhat it is
textstringThe text; at most 64 KiB. Required.
keystroke_delaydurationDelay between keystrokes; default 12 ms.

#WaitAction

FieldTypeWhat it is
durationdurationHow long; at most 30 seconds. Required.

#Region

FieldTypeWhat it is
xint32Left edge. Required.
yint32Top edge. Required.
widthint32Width. Required.
heightint32Height. Required.

#Point

FieldTypeWhat it is
xint32Pixels from the left edge. Required.
yint32Pixels from the top edge. Required.

#Response

FieldTypeWhat it is
resultsActionResult[]One result per action, in order.
screenshotScreenshotThe screenshot after the last action, when requested.
lease_generationint64The lease generation the actions ran under.
controlControlStateThe control the actions ran under.

#ActionResult

FieldTypeWhat it is
cursorPointThe pointer position after the action (and the answer of cursor_position).
imageScreenshotFor take_screenshot and zoom.

#Screenshot

FieldTypeWhat it is
databytesThe encoded image.
media_typestringimage/png, image/jpeg, or image/webp.
widthint32Image width in pixels.
heightint32Image height in pixels.
display_widthint32The display's logical width; divide to map image pixels to action coordinates.
display_heightint32The display's logical height.
capture_timetimestampWhen it was captured.

#ControlState

FieldTypeWhat it is
holderControlHolderWho holds control; UNSPECIFIED when nobody does (agent actions allowed). Output only. One of agent, human.
epochint64Increases on every acquire; release names it. Output only.
principalstringThe Access principal that acquired control. Output only.
holder_labelstringThe caller's label for the person or agent, for example a user id. Output only.
acquire_timetimestampWhen control was acquired. Output only.
expire_timetimestampWhen control lapses unless re-acquired. Output only.

#Point

FieldTypeWhat it is
xint32Pixels from the left edge. Required.
yint32Pixels from the top edge. Required.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease:act" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'