Skip to main content

Python SDK for the use.computer macOS and iOS Computer Use API

Project description

use-computer Python SDK

Python client for use.computer — rent dedicated Mac minis with macOS and Apple simulator sandboxes built for computer-use agents.

pip install use-computer
export USE_COMPUTER_API_KEY=mk_live_...
from use_computer import Computer, SandboxType, SimulatorFamily

with Computer().create() as mac:
    mac.exec_ssh("open -a TextEdit")
    mac.keyboard.type("hello")
    png = mac.screenshot.take_full_screen()

with Computer().create(type=SandboxType.IOS, family=SimulatorFamily.TV) as tv:
    tv.screenshot.take_full_screen()
    tv.input.press_remote("select")

with Computer().create(type=SandboxType.IOS) as ios:
    ios.input.long_press(120, 300, duration=1.0)

Windows (Beta)

with Computer().create(type="windows") as win:
    print(win.run("$env:COMPUTERNAME").stdout)   # PowerShell exec (no SSH)
    win.keyboard.type("hello")
    win.screenshot.take_full_screen()
    win.ui_tree()                                 # native Windows UIAutomation tree

Windows sandboxes are Beta (admin-only). Same mouse/keyboard/screenshot/ recording/file surface as macOS; exec runs in-guest via PowerShell/cmd (win.run / win.shell) instead of SSH. AsyncWindowsSandbox mirrors it. See docs.use.computer/docs/windows.

Full DSL reference (macOS + simulator): docs.use.computer/docs/sdk

Simulator sandboxes use type=SandboxType.IOS for the SDK route, but device_type and runtime can target any installed compatible CoreSimulator pair: iPhone or iPad with iOS, Apple Watch with watchOS, Apple TV with tvOS, or Apple Vision with visionOS. Prefer family=SimulatorFamily.TV/WATCH/VISION unless you need to pin raw CoreSimulator identifiers. Raw strings like type="ios" still work for compatibility. If omitted, the gateway defaults to iPhone 17 Pro on the latest installed iOS runtime. Known-incompatible simulator types are filtered from family selection, including the non-4K Apple Vision Pro type on current fleet runtimes.

Per-family input

iPhone / iPad sims have full touch + on-screen keyboard. Apple Watch supports touch + crown / button (no type_text — watchOS keyboard isn't exposed). Apple TV has no touch — drive it with input.press_remote(RemoteButton.SELECT) (the remote D-pad, select, menu, home, play/pause). Apple Vision (visionOS) is BETA: sessions display and you can screenshot / launch apps, but input.tap is a no-op because there's no XCTest-free coordinate tap path on visionOS yet. Use it for read-only flows for now.

Examples

File What it shows
examples/_1_hello_macos.py create → exec → keyboard → screenshot
examples/_2_hello_ios.py create iPhone sim → open URL → screenshot
examples/_3_recording.py start / stop / download a screen recording
examples/_4_file_transfer.py upload bytes, download a file back
examples/_5_keepalive.py heartbeat for sessions idle > 2 min
examples/_6_hello_tvos.py tvOS: pick TV family + drive the Apple Remote

For agent loops and evals: use-computer-cookbook.

Skill for AI coding assistants

Point your assistant at use-computer-cookbook/skills/SKILL.md — short body with per-topic references for macOS, Apple simulators, lifecycle, and the Harbor harness.

HTTP API

Every SDK method wraps https://api.use.computer/v1/... with Authorization: Bearer mk_live_.... Swagger: api.use.computer/docs. OpenAPI spec: api.use.computer/openapi.yaml.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

use_computer-0.0.21.tar.gz (81.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

use_computer-0.0.21-py3-none-any.whl (39.4 kB view details)

Uploaded Python 3

File details

Details for the file use_computer-0.0.21.tar.gz.

File metadata

  • Download URL: use_computer-0.0.21.tar.gz
  • Upload date:
  • Size: 81.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for use_computer-0.0.21.tar.gz
Algorithm Hash digest
SHA256 d9843ae19d41b149c00894a6f57024b7e980861d3f77cfebf0d1417bc0fd9793
MD5 2df0aa3af67e56f7f7ba10b5a9089b44
BLAKE2b-256 c5d12a5ada75e1900ad7953727610ecc5813e74f127d24a67661c5867da565f7

See more details on using hashes here.

File details

Details for the file use_computer-0.0.21-py3-none-any.whl.

File metadata

  • Download URL: use_computer-0.0.21-py3-none-any.whl
  • Upload date:
  • Size: 39.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for use_computer-0.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 b58eca79256ec14bf2533b9f38897aae7468f542bb6d9c0998d0b072e2e7673b
MD5 4e31353f290c3203fdef7f7392b5d311
BLAKE2b-256 4e2e838f73a3977b727beb6ade9324f5454457b15a96e3862614f9fdf07860db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page