---
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', required — Mouse button to click
    - `click_type` 'down' | 'up' | 'click' — Type of click (down, up, or click). Defaults to 'click'
    - `coordinates` number[] — X and Y coordinates [x, y]
    - `num_clicks` number — Number of clicks. Defaults to 1
    - `hold_keys` string[] — Keys to hold while clicking
    - `screenshot` boolean — Whether to take a screenshot after the action
  - object
    - `action` 'drag_mouse', required
    - `path` array[], required — Array of [x, y] coordinate pairs
      - number[]
    - `hold_keys` string[] — Keys to hold while dragging
    - `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
    - `keys` string[], required — Keys to press
    - `duration` number — Duration to hold keys in seconds
    - `screenshot` boolean — Whether to take a screenshot after the action
  - object
    - `action` 'type_text', required
    - `text` string, required — Text to type
    - `hold_keys` string[] — Keys to hold while typing
    - `screenshot` boolean — Whether to take a screenshot after the action
  - 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
  - `output` string — Output message from the action
  - `error` string — Error message if action failed
  - `base64_image` string — Base64 encoded screenshot if requested
  - `system` string — System information

## Other responses

- `400` — Default Response
- `500` — Default Response

## Changes

- **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 changed from `object` to no type
  - 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
- **2025-11-14** `f62eb21825a7` — 2 breaking
  - 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
  - the request's body type changed from no type to `object`
- **2025-11-13** `a7c3e89bea1f` — 1 info
  - endpoint added

[Change 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/45efcdf3e5cc/schema)
