PandaStack

Quickstart

Spawn your first sandbox in 30 seconds — curl, Python, and TypeScript.

You'll need an API key. Sign in at dev.pandastack.ai, open Settings → Tokens, and create one. It looks like dam_xxx….

export PANDASTACK_API_KEY=dam_xxxxxxxxxxxxxxxx
export PANDASTACK_API=https://api-dev.pandastack.ai

curl

# 1. Create a sandbox from the code-interpreter template.
SBX=$(curl -sX POST "$PANDASTACK_API/v1/sandboxes" \
  -H "authorization: Bearer $PANDASTACK_API_KEY" \
  -H "content-type: application/json" \
  -d '{"template":"code-interpreter","cpu":1,"memory_mb":512}' \
  | jq -r .id)

echo "sandbox: $SBX"

# 2. Run a command inside it.
curl -sX POST "$PANDASTACK_API/v1/sandboxes/$SBX/exec" \
  -H "authorization: Bearer $PANDASTACK_API_KEY" \
  -H "content-type: application/json" \
  -d '{"cmd":"python -c \"print(2+2)\""}'

# 3. Delete it when you're done.
curl -sX DELETE "$PANDASTACK_API/v1/sandboxes/$SBX" \
  -H "authorization: Bearer $PANDASTACK_API_KEY"

Python

pip install pandastack
from pandastack import Sandbox

with Sandbox(template="code-interpreter") as sb:
    result = sb.run("python -c 'print(2+2)'")
    print(result.stdout)  # "4\n"

    # Mutate the filesystem
    sb.write("/tmp/data.csv", "a,b\n1,2\n")
    print(sb.read("/tmp/data.csv"))

TypeScript / Node.js

npm install @pandastack/sdk
import { Sandbox } from "@pandastack/sdk";

const sb = await Sandbox.create({ template: "code-interpreter" });

const { stdout } = await sb.run(`python -c "print(2+2)"`);
console.log(stdout); // "4\n"

await sb.close();

What just happened

When you POST to /v1/sandboxes, the orchestrator:

  1. Allocates a NATID slot (private IP + isolated netns) from a pre-warmed pool — ~5 ms.
  2. Restores a Firecracker snapshot of the template — ~240 ms for code-interpreter.
  3. Clones the template rootfs via XFS reflink — ~5 ms (copy-on-write, not byte copy).
  4. Returns the sandbox ID before SSH is even reachable; subsequent exec calls block on SSH ready.

That's why total wall-clock from POST to 200 OK is consistently under 300 ms.

Next steps

On this page