Deploy a Browser instance

BrowserInstance

The BrowserInstance is a lightweight Chromium instance that supports interactive streaming, computer actions, Playwright CDP control, and saving/loading auth states. We recommend using this instance type if your task is constrained to the browser.

  • Fastest start up time
  • 1x compute cost

Start a browser instance

1instance = client.start_browser()

Available actions

get_cdp_url

Get the Playwright CDP URL

1cdp_url = instance.get_cdp_url().cdp_url

save_auth

Save the browser auth state

1auth_state_id = instance.browser.save_auth(name="default").auth_state_id

authenticate

Authenticate the browser using a saved auth state

1instance.browser.authenticate(auth_state_id=auth_state_id)

screenshot

Take a base64 encoded image of the current desktop

1base_64_image = instance.screenshot().base_64_image

get_stream_url

Get the interactive stream URL

1stream_url = instance.get_stream_url().stream_url

computer

Perform computer actions with the mouse and keyboard

key

Press a key or combination of keys

text

1instance.computer(action="key", text="ctrl+c")

type

Type text into the active window

text

1instance.computer(action="type", text="Hello world")

mouse_move

Move mouse cursor to specific coordinates

coordinate [x, y]

1instance.computer(action="mouse_move", coordinate=[100, 200])

left_click_drag

Click and drag from current position to specified coordinates

coordinate [x, y]

1instance.computer(action="left_click_drag", coordinate=[300, 400])

scroll

Scroll horizontally and/or vertically (pixels converted to clicks)

coordinate [x, y]

Scroll down 200px
1instance.computer(action="scroll", coordinate=[0, 200])
Scroll right 300px
1instance.computer(action="scroll", coordinate=[300, 0])

left_click

Perform a left mouse click at current position

1instance.computer(action="left_click")

right_click

Perform a right mouse click at current position

1instance.computer(action="right_click")

middle_click

Perform a middle mouse click at current position

1instance.computer(action="middle_click")

double_click

Perform a double left click at current position

1instance.computer(action="double_click")

screenshot

Take a screenshot of the desktop

1screenshot = instance.computer(action="screenshot").base64_image

cursor_position

Get current mouse cursor coordinates

1cursor_position = instance.computer(action="cursor_position").output

wait

Wait for 3 seconds

1instance.computer(action="wait")

stop

Stop the instance

1instance.stop()

pause

Pause the instance

1instance.pause()

resume

Resume the instance

Resume with default timeout
1instance.resume()
Resume with custom timeout
1instance.resume(timeout_hours=2.5)

Compatible tools

  • ComputerTool
  • BrowserTool
Built with