Runloop

A sandbox per Runloop devbox. AI-focused devboxes with suspend/resume and disk snapshots, via @runloop/api-client.

Installation

@runloop/api-client is an optional peer dependency of sbox-sdk, loaded lazily on first use.

pnpm add sbox-sdk @runloop/api-client

Usage

import { createSandboxClient } from "sbox-sdk";
import { runloop } from "sbox-sdk/runloop";

const client = createSandboxClient({
  provider: runloop({ apiKey: process.env.RUNLOOP_API_KEY! }),
});

const sandbox = await client.create({ template: "my-blueprint" });
const res = await sandbox.commands.run("python --version");
console.log(res.stdout);

// Snapshot the disk, then fork two fresh devboxes from it.
const forks = await sandbox.snapshots!.fork(2);

await sandbox.pause(); // suspend — memory preserved

template is a blueprint id, or a snapshot id (snp…) to restore disk state into a new devbox. create() polls until the devbox is running.

Exec is the buffered executeSync (streaming emulated); the devbox runs it through a shell, so the core folds cwd/env into a cd … && KEY=v … wrapper (perCommandEnvCwd: false). Files use the binary-safe downloadFile / uploadFile endpoints. suspend/resume map to pause()/resume() (memory preserved); shutdown is destroy(). snapshots.create() is snapshotDisk and fork() snapshots then boots N devboxes — in-place restore is not supported (snapshots create new devboxes).

Authentication

A single API key.

Authentication variables for the runloop adapter.
OptionEnv varRequiredDescription
apiKeyRUNLOOP_API_KEYrequiredRunloop API key (sent as the SDK bearer token).
baseURLoptionalOverride the Runloop API base URL.
blueprintIdoptionalDefault blueprint id when a spec omits `template`.

Options

Prop

Type

Capabilities

CapabilityLevelNotes
listnative
pausenativesuspend (memory preserved)
streamingemulatedexecuteSync is buffered
filesUploadnativebinary uploadFile
exposePortnativetunnel via enableTunnel
snapshot / forknativesnapshotDisk; fork = boot N
codeInterpreterunsupported
stopunsupportedpause (suspend) / destroy

perCommandEnvCwd is false (core wraps); preservesMemoryOnPause is true; previewModel is subdomain. In-place snapshot restore reports NotSupported.

On this page