Run coding agents
Let an agent install packages, edit files, and run tests in a separate VM. Choose an image with its tools installed, then read command output and collect the changed files.
Choose a base imageRun commands, edit files, and start services in an isolated VM. Sandboxes start in under 50 ms. Use a provided image or your own, and save memory snapshots to restore later.
Let an agent install packages, edit files, and run tests in a separate VM. Choose an image with its tools installed, then read command output and collect the changed files.
Choose a base imageRun a development server and expose its port through a URL. Review the application in a browser while the server runs. Require a token to restrict access to the preview.
Expose a serviceInstall dependencies, prepare the project, and take a memory snapshot. Start later sandboxes from that saved state. Mount a persistent volume for files that need to survive after a sandbox stops.
Create a snapshotStart a sandbox with the project's runtime and dependencies, then copy in the source files. An agent can edit the code and run the project's build and test commands. Read the command output to inspect failures and retrieve the changed files when the task is done.
For a web app, run its development server in the same VM and expose a port for browser review. Save a snapshot after dependency installation to reuse that setup for later tasks. Keep ongoing project files on a persistent volume, and stop the VM when you finish.
Create and stop VMs through the SDK or CLI. Each VM has a runtime API for commands, files, and processes.
Each sandbox has an authenticated runtime URL for executing commands, managing processes, and reading or writing files.
Expose a service running inside the VM through a public URL or require a token to access it.
Capture memory, running processes, and filesystem state. Restore the snapshot in a new sandbox.
Keep project files and dependency caches after a sandbox stops. Mount the same volume in other sandboxes within your team.
Choose an Ubuntu 24.04 image with Node, Python, Playwright Chromium, or an agent CLI such as Claude Code, Codex, or OpenClaw.
Use the hx CLI to package a local Docker image for sandbox creation. Its environment variables and entrypoint are preserved.
Execute commands, start background processes, stream output, or open an interactive terminal.
Read and write files, watch a directory for changes, and move files between the sandbox and your machine.
Disable internet access or allow outbound traffic by domain, IP, or CIDR range. Deny traffic by IP or range. Update the policy while the VM runs.
Choose a base image, custom image, or saved snapshot. Configure vCPU, memory, disk, and a timeout.
Run commands, start background processes, or open a terminal. Expose a port to access a service running in the sandbox.
Retrieve the output files or save them on a mounted volume. Take a snapshot if you need to restore the running environment. Stop the VM when finished, and set a timeout in case your code fails to close it.
These examples run a command, save a snapshot, and stop the VM. For Node or Python, set HYPERBROWSER_API_KEY in your environment. The CLI example requires hx authentication and jq.
1// yarn add @hyperbrowser/sdk2import { Hyperbrowser } from "@hyperbrowser/sdk";34const client = new Hyperbrowser({5 apiKey: process.env.HYPERBROWSER_API_KEY,6});78const sandbox = await client.sandboxes.create({9 imageName: "node",10 cpu: 2,11 memoryMiB: 2048,12 timeoutMinutes: 30,13});14console.log("Runtime URL:", sandbox.runtime.baseUrl);1516try {17 const result = await sandbox.exec("node -e 'console.log(2 ** 10)'");18 console.log(result.stdout); // 10241920 const snapshot = await sandbox.createMemorySnapshot({21 snapshotName: "node-after-setup",22 });23 console.log("Snapshot:", snapshot.snapshotId);24} finally {25 await sandbox.stop();26}Both vCPU and allocated memory are billed while the sandbox runs. 1 credit = $0.001.
| Usage | Credits | Price |
|---|---|---|
| vCPU | 45 credits / vCPU-hour | $0.045 / vCPU-hour |
| Memory | 15 credits / GiB-hour | $0.015 / GiB-hour |
A browser session runs Chrome, which you control through an automation library. A sandbox is a VM where you can install packages, execute commands, edit files, and run services. Use it for tasks such as building an application or running a test suite.
Read moreUse a snapshot to restore a VM's memory, processes, and files as they were when you saved it. Use a volume for files that change across runs, such as project files or caches. The volume remains available after the sandboxes using it stop.
Read moreYes. Package a local Docker image with the hx CLI, then create sandboxes from it. The image supplies your dependencies, environment variables, and entrypoint. You can also start with a provided base image.
Read moreYes. Disable internet access or allow outbound traffic to selected domains, IPs, or CIDR ranges. You can also deny IPs and ranges. Policies can change while the VM runs. Configure access to exposed services separately through port settings.
Read more
Includes 5,000 credits for browsers, sandboxes, and web data.