Skip to main content
Create allocates a sandbox from a template, applies CPU, memory, timeout, environment, metadata, network, desktop, and volume options, and returns a sandbox ID once the runtime is ready to accept work.

What state changes

  • A new sandbox enters the running set for your API key.
  • Template runtime defaults and create-time overrides become the sandbox’s initial process and filesystem environment.
  • Optional public traffic credentials are minted for exposed ports.

Usage

from nullspace import Sandbox

with Sandbox.create(template="base", timeout=300) as sandbox:
    print(sandbox.id)
    result = sandbox.commands.run("pwd", shell=True)
    print(result.stdout.strip())
API reference: createSandbox (POST /v1/sandboxes). Guide: Sandboxes. Example: Examples.