Skip to main content
Install the SDK into a Python 3.11+ environment. The CLI extra gives you nullspace auth login for local credential setup:
python -m pip install "nullspace-sdk[cli]==0.1.9"
For local interactive use, save the API endpoint and key:
nullspace auth login --api-url https://api.13-215-85-171.sslip.io
For a self-hosted single-host appliance in localhost/no-domain mode:
export NULLSPACE_API_KEY="$(sudo cat /etc/nullspace/operator-api-key)"
export NULLSPACE_API_URL=http://localhost
For owned-domain appliance mode, use your Caddy/API origin:
export NULLSPACE_API_URL=https://nullspace.example
For scripts, CI, and coding agents, you can still set NULLSPACE_API_KEY and NULLSPACE_API_URL as environment variables.

Core imports

from nullspace import Sandbox, Template, Volume
Use Sandbox for live runtime work, Template for reusable environments, and Volume for persistent shared filesystems on volume-enabled deployments.

First sandbox

from nullspace import Sandbox

with Sandbox.create(template="base") as sandbox:
    result = sandbox.commands.run("python3 --version", shell=True)
    print(result.stdout.strip())
The SDK accepts explicit api_key= and base_url= arguments. SDK and CLI share configuration precedence: environment variables, project .env, ~/.config/nullspace/config.json, then legacy ~/.nullspace/config.json. nullspace auth login --api-url ... still writes the legacy path for backward compatibility. See SDK Config. Concepts: Create, Exec. API reference: createSandbox, execCommand. Self-hosted setup: Self-Hosted Single-Host.