Quickstart

Control a real macOS or iOS sandbox from code.

use.computer gives agents a clean API for screenshots, mouse, keyboard, files, recordings, and browser or app automation.

Install

pip install use-computer

Create a sandbox

from use_computer import Computer

client = Computer(api_key="mk_live_...")
sandbox = client.create()

shot = sandbox.screenshot
image = shot.take_full_screen()
sandbox.mouse.click(500, 400)
sandbox.keyboard.type("hello")

sandbox.close()
client.close()

Use environment variables

export USE_COMPUTER_API_KEY=mk_live_...
export USE_COMPUTER_BASE_URL=https://api.use.computer

USE_COMPUTER_BASE_URL is optional. Production defaults to https://api.use.computer.

Use the dev API

export USE_COMPUTER_BASE_URL=https://api.dev.use.computer

What to read next