---
title: "Execute computer action"
method: POST
path: "/v1/sessions/{sessionId}/computer"
tags: ["Computer"]
---

# Execute computer action

`POST /v1/sessions/{sessionId}/computer`

Execute computer actions like mouse movements, clicks, keyboard input, and more

## Path parameters

- `sessionId` string, required

## Request body

- union
  - object
    - `action` 'move_mouse', required
    - `coordinates` number[], required — X and Y coordinates [x, y]
    - `hold_keys` string[] — Keys to hold while moving
    - `screenshot` boolean — Whether to take a screenshot after the action
  - object
    - `action` 'click_mouse', required
    - `button` 'left' | 'right' | 'middle' | 'back' | 'forward' — Mouse button to click. Defaults to 'left'
    - `click_type` 'down' | 'up' | 'click' — Type of click (down, up, or click). Defaults to 'click'
    - `coordinates` number[] — X and Y coordinates [x, y]
    - `hold_keys` string[] — Keys to hold while clicking
    - `num_clicks` number — Number of clicks. Defaults to 1
    - `screenshot` boolean — Whether to take a screenshot after the action
  - object
    - `action` 'drag_mouse', required
    - `hold_keys` string[] — Keys to hold while dragging
    - `path` array[], required — Array of [x, y] coordinate pairs
      - number[]
    - `screenshot` boolean — Whether to take a screenshot after the action
  - object
    - `action` 'scroll', required
    - `coordinates` number[] — X and Y coordinates [x, y]
    - `delta_x` number — Horizontal scroll amount. Defaults to 0
    - `delta_y` number — Vertical scroll amount. Defaults to 0
    - `hold_keys` string[] — Keys to hold while scrolling
    - `screenshot` boolean — Whether to take a screenshot after the action
  - object
    - `action` 'press_key', required
    - `duration` number — Duration to hold keys in seconds
    - `keys` string[], required — Keys to press
    - `screenshot` boolean — Whether to take a screenshot after the action
  - object
    - `action` 'type_text', required
    - `hold_keys` string[] — Keys to hold while typing
    - `screenshot` boolean — Whether to take a screenshot after the action
    - `text` string, required — Text to type
  - object
    - `action` 'wait', required
    - `duration` number, required — Duration to wait in seconds
    - `screenshot` boolean — Whether to take a screenshot after the action
  - object
    - `action` 'take_screenshot', required
  - object
    - `action` 'get_cursor_position', required

## Response `200`

Default Response

- ComputerActionResponse
  - `base64_image` string — Base64 encoded screenshot if requested
  - `error` string — Error message if action failed
  - `output` string — Output message from the action
  - `system` string — System information

## Other responses

- `400` — An error response from the API
- `500` — An error response from the API

---

[API](https://skmtc.net/steel-dev/apis/steel-api.md) · [All operations](https://skmtc.net/steel-dev/apis/steel-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/steel-dev/steel-api/revisions/2248d956188a/schema)
