Skip to main content

Overview

The unified computer action API allows for granular control over all aspects of the Bytebot virtual desktop environment through a single endpoint. It replaces multiple specific endpoints with a unified interface that handles various computer actions like mouse movements, clicks, key presses, and more.

Endpoint

Request Format

All requests to the unified endpoint follow this format:
The action parameter determines which operation to perform, and the remaining parameters depend on the specific action.

Available Actions

move_mouse

Move the mouse cursor to a specific position. Parameters: Example:

trace_mouse

Move the mouse along a path of coordinates. Parameters: Example:

click_mouse

Perform a mouse click at the current or specified position. Parameters: Example:

press_mouse

Press or release a mouse button at the current or specified position. Parameters: Example:

drag_mouse

Click and drag the mouse from one point to another. Parameters: Example:

scroll

Scroll up, down, left, or right. Parameters: Example:

type_keys

Type a sequence of keyboard keys. Parameters: Example:

press_keys

Press or release keyboard keys. Parameters: Example:

type_text

Type a text string with optional delay. Parameters: Example:

paste_text

Paste text to the current cursor position. This is especially useful for special characters that aren’t on the standard keyboard. Parameters: Example:

wait

Wait for a specified duration. Parameters: Example:

screenshot

Capture a screenshot of the desktop. Parameters: None required Example:

cursor_position

Get the current position of the mouse cursor. Parameters: None required Example:

application

Switch between different applications or navigate to the desktop/directory. Parameters: Available Applications:
  • firefox - Mozilla Firefox web browser
  • 1password - Password manager
  • thunderbird - Email client
  • vscode - Visual Studio Code editor
  • terminal - Terminal/console application
  • desktop - Switch to desktop
  • directory - File manager/directory browser
Example:

write_file

Write a file to the desktop environment filesystem. Parameters: Example:

read_file

Read a file from the desktop environment filesystem. Parameters: Example:

Response Format

The response format varies depending on the action performed.

Standard Response

Most actions return a simple success response:

Screenshot Response

Cursor Position Response

Write File Response

Read File Response

Error Response

Code Examples

JavaScript/Node.js Example