Skip to main content
Create an AI sandbox with Python, run a command on its Linux machine and delete it with beadrun. Python 3.11 or later is supported.

Install and authenticate

Set BEAD_API_KEY through your secret manager or private environment. Get an account through agent signup. The SDK defaults to https://api.bead.run; set BEAD_API_URL for another deployment.

Run a command

The context manager deletes the machine on normal exit and exceptions. The machine lifetime defaults to 300 seconds; all SDK timeouts use seconds. A disconnected process does not stop remote compute. A nonzero command exit is a result, with exit_code, stdout and stderr. Inspect it before starting dependent work.

Use async

Breaking output iteration stops reading; it does not guarantee the remote process stopped. Use machine cleanup when work is finished. See Python SDK reference for files, snapshots, fleets, swarms and error handling.