---
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

## Changes

- **2026-06-16** `7b73b0d57792` — 1 breaking
  - request body became required
- **2026-06-07** `4985d7bcd32f` — 2 info
  - added the optional property `linkToDocs` to the response with the `400` status
  - added the optional property `linkToDocs` to the response with the `500` status
- **2026-05-22** `39bc3eb693fb` — 2 info
  - the request property `oneOf[subschema #2]/button` became optional
  - the `button` request property default value `left` was added
- **2026-01-08** `97dcad9b050e` — 1 breaking, 3 info
  - removed `subschema #1, subschema #2, subschema #3, subschema #4, subschema #5, subschema #6, subschema #7, subschema #8, subschema #9` from the request body `anyOf` list
  - added `subschema #1, subschema #2, subschema #3, subschema #4, subschema #5, subschema #6, subschema #7, subschema #8, subschema #9` to the request body `oneOf` list
  - the response property `context/items/params` became required for the status `400`
  - the response property `context/items/params` became required for the status `500`
- **2025-11-14** `a7c3e89bea1f` — 1 breaking, 1 info
  - the request's body type/format changed from `object`/`` to ``/``
  - added `subschema #1, subschema #2, subschema #3, subschema #4, subschema #5, subschema #6, subschema #7, subschema #8, subschema #9` to the request body `anyOf` list

[Full history](https://skmtc.dev/steel-dev/apis/steel-api/changes/v1/sessions/:sessionId/computer/post.md)

---

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