Daytona

A full-featured sandbox — code interpreter with charts, stop/pause/resume, preview links, and regions. Backed by @daytonaio/sdk.

Installation

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

pnpm add sbox-sdk @daytonaio/sdk

Usage

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

const client = createSandboxClient({
  provider: daytona({ apiKey: process.env.DAYTONA_API_KEY!, target: "us" }),
});

const sandbox = await client.create({ template: "debian:12" });

// Daytona has a code interpreter, so `sandbox.code` is defined:
const exec = await sandbox.code.runCode("print(2 + 2)");
console.log(exec.logs.stdout);

await sandbox.pause(); // preserves memory
await sandbox.resume();

template is treated as a Daytona snapshot name, or — when it contains a / or : — as a container image (e.g. "debian:12"). Daytona's API works in seconds; the adapter converts from the SDK's milliseconds for you.

For v0.1, snapshot and background are scoped to unsupported to keep the surface honest — reach for raw() for Daytona-only features in the meantime.

Authentication

A single API key (plus an optional region).

Authentication variables for the daytona adapter.
OptionEnv varRequiredDescription
apiKeyDAYTONA_API_KEYrequiredYour Daytona API key.
apiUrlDAYTONA_API_URLoptionalOverride the Daytona API URL (self-hosted).
targetDAYTONA_TARGEToptionalTarget region, e.g. "us" or "eu".

Options

Prop

Type

Capabilities

CapabilityLevelNotes
list / setTimeoutnativesetTimeout = autostop interval
stop / pausenativeresume re-starts the sandbox
streamingemulatedexecuteCommand is buffered
filesUploadnative
codeInterpreternativesandbox.code is defined
statefulKernelunsupported
exposePortnativetokenized preview links
regionnativetarget: "us" | "eu"
snapshot / fork / backgroundunsupported

preservesMemoryOnPause and preservesDiskOnStop are both true; previewModel is subdomain.

On this page