Create the sandbox
AsyncDaytona() reads the API key from DAYTONA_API_KEY. daytona.create(...) spins up a sandbox from the desktop snapshot; the call returns once the sandbox is ready for filesystem and process operations. The sandbox handle is what we pass to everything downstream: the form uploader, the HTTP server launcher, the recording API, and the DaytonaAsyncComputer adapter.
We hold onto daytona and sandbox as notebook-level variables so later cells can operate on them, and we tear them down explicitly in the last cell.
python
daytona = AsyncDaytona()
sandbox = await daytona.create(
CreateSandboxFromSnapshotParams(snapshot=_DESKTOP_SNAPSHOT),
)
print(f"Sandbox ready: {sandbox.id}")text
Sandbox ready: 6a6ca6a5-f49a-4562-a3f2-4d1717c0131d