Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.superserve.ai/llms.txt

Use this file to discover all available pages before exploring further.

Sandbox.create() boots a fresh VM and returns when it’s ready to use. There’s no readiness check or polling - the returned instance is already active.
import { Sandbox } from "@superserve/sdk"

const sandbox = await Sandbox.create({ name: "data-analyzer" })

With options

Attach metadata tags, inject environment variables, cap the active lifetime, or lock down network egress at creation time.
import { Sandbox } from "@superserve/sdk"

const sandbox = await Sandbox.create({
  name: "data-analyzer",
  timeoutSeconds: 3600,
  metadata: { env: "prod", owner: "agent-7" },
  envVars: { OPENAI_API_KEY: "sk-..." },
  network: {
    allowOut: ["api.openai.com", "*.github.com"],
    denyOut: ["0.0.0.0/0"],
  },
})

Common options

OptionTypeDescription
namestringRequired. Human-readable sandbox name.
timeoutSeconds / timeout_secondsnumberMax time the sandbox can stay active before auto-pause.
metadataRecord<string, string>String tags. See Metadata.
envVars / env_varsRecord<string, string>Env vars applied to every process. See Environment variables.
networkNetworkConfigEgress allow/deny rules. See Networking.
See the Sandbox reference for every option including apiKey, baseUrl, and signal.

Create from a template

Boot a sandbox from a system or team template via fromTemplate (name, UUID, or Template instance).
const sandbox = await Sandbox.create({
  name: "my-sandbox",
  fromTemplate: "superserve/python-3.11",  // name
})
The sandbox’s vCPU, memory, and disk size are inherited from the template; they cannot be overridden. See Templates overview for how to build your own. Next: run commands, write files, or pause the sandbox to save costs between runs.