Computers

Computers are the unit of work in Agent Computer. This page covers the full lifecycle: creation, connection, sharing, SSH, ports, and snapshots.

Create computers

Choose a size preset or pass explicit RAM and persistent storage. Three presets are available:

PresetRAMStorage
ram-2g (default)2 GiB5 GiB
ram-4g4 GiB10 GiB
ram-8g8 GiB25 GiB
computer create my-computer

Pass --size ram-4g to override the default preset:

computer create my-computer --size ram-4g
computer create my-computer --memory 16 --storage 50

Custom sizes use GiB in the CLI and must stay within the account resource limits returned by resource_limits. The current limits are 2-64 GiB RAM in 1 GiB steps and 5-250 GiB storage in 1 GiB steps.

In the SDK, pass a preset or explicit RAM/storage values when creating a computer:

const computer = await ac.computers.create({
  handle: "my-computer",
  memoryMiB: 16 * 1024,
  storageBytes: 50 * 1024 * 1024 * 1024,
});

In the API, pass size_presetor requested_memory_mib plus requested_storage_bytes. Check capacity before creation with POST /v1/computer-capacity/check.

macOS computers

Create a macOS computer by passing --os macos. macOS computers boot a full QEMU/KVM VM and expose the desktop through VNC. The default macOS size is 4 GiB RAM with a 64 GiB guest disk.

computer create my-mac --os macos
computer open my-mac --vnc

Use macOS computers when you need native macOS applications or desktop workflows. Linux-only features such as exec, file operations, mounts, published ports, resize, and snapshots are not available on macOS computers yet.

Connect to computers

Every computer has a primary browser surface and can also expose SSH and the managed desktop.

computer open my-computer
computer open my-computer --vnc
computer ssh my-computer

Sharing

Share links and email shares let other users open the same computer through the browser without sharing your raw credentials.

SSH

SSH is the terminal surface for computers. The CLI handles host, port, and key selection automatically.

computer ssh my-computer

Run computer ssh without a handle to pick from your computers interactively.

Alias

Use computer ssh --setup when you want a stable local alias for standard ssh workflows.

Clipboard

SSH shells include pbcopy and pbpaste for moving text between your local computer and the remote session.

Exec

Run a command on a running computer and get stdout, stderr, and the exit code back as JSON. No SSH keys or sessions required.

curl -X POST https://api.agentcomputer.ai/v1/computers/<id>/exec \ -H "Authorization: Bearer <api-key>" \ -H "Content-Type: application/json" \ -d '{"command": ["echo", "hello"]}'

The response includes exit_code, stdout, stderr, and duration_ms. Optional fields: cwd (working directory), env (environment variables), timeout_ms (max 300000), and user (default: node).

Ports

Publishing a port gives it a stable public hostname. The API and CLI derive the final URL from the computer handle and the published port name.

computer ports publish my-computer 3000

Ports are public by default: the resulting URL is reachable from the open internet without an access session, which is what you want for webhooks and other unauthenticated callers. Pass --private to require an access session instead, and use --name if you want a human-friendly published name instead of the port number.

List and remove

computer ports ls my-computer
computer ports rm my-computer 3000

The CLI prints the final URL when the API returns it, so you do not have to reconstruct the hostname by hand.

Snapshots

Use snapshots when you want a saved computer state you can return to later.

computer snapshot create my-computer
computer snapshot restore <snapshot-id> restored-computer