Fly Machines
A sandbox per Fly Machine over the Machines REST API. Pure fetch — no SDK — so it runs anywhere the core does, including the edge.
Installation
No provider SDK required — the adapter talks to the Fly Machines REST API with fetch, so it's edge-portable.
pnpm add sbox-sdkUsage
import { createSandboxClient } from "sbox-sdk";
import { fly } from "sbox-sdk/fly";
const client = createSandboxClient({
provider: fly({
apiToken: process.env.FLY_API_TOKEN!,
appName: "my-fly-app", // must already exist
region: "iad",
}),
});
const sandbox = await client.create({ template: "ubuntu:22.04" });
const res = await sandbox.commands.run("uname -a");
console.log(res.stdout);The Fly app must exist; each sandbox is a Machine inside it. template is the machine's container image.
Fly's /exec is buffered and has no per-command cwd/env, so the core
folds those into a cd … && KEY=v … wrapper (perCommandEnvCwd: false) and
streaming is emulated. stop() releases compute but the rootfs resets
unless a volume is attached (preservesDiskOnStop: false). Files are read and
written via exec + base64.
Authentication
An API token + the target app name.
| Option | Env var | Required | Description |
|---|---|---|---|
apiToken | FLY_API_TOKEN | required | Fly API token (`fly auth token`). |
appName | FLY_APP_NAME | required | The Fly app the machines run in (must already exist). |
region | FLY_REGION | optional | Default region, e.g. "iad". |
image | — | optional | Default machine image. |
appDomain | — | optional | Public app domain for preview URLs; defaults to <appName>.fly.dev. |
apiBaseUrl | — | optional | Override the Machines API base URL. |
Options
Prop
Type
Capabilities
| Capability | Level | Notes |
|---|---|---|
list / region | native | |
stop / pause | native | pause = suspend (memory kept) |
streaming | emulated | /exec is buffered |
filesUpload | native | via exec + base64 |
exposePort | native | preview at <app>.fly.dev |
codeInterpreter | unsupported | |
snapshot / fork | unsupported |
perCommandEnvCwd is false (core wraps); preservesMemoryOnPause is true; preservesDiskOnStop is false; previewModel is subdomain.
Modal
Modal sandboxes with streaming exec and first-class GPU. Backed by the modal JS SDK; an App + Image are created lazily.
AWS Lambda MicroVMs
Firecracker-based serverless sandboxes (GA June 2026) with suspend/resume up to 8h. Control plane via @aws-sdk/client-lambda-microvms; you bake a small runner into the image.