Skip to main content
This example uses examples/python/agent_deployments/minimal_service/nullspace.agent.toml to package a Python HTTP server, start it as a managed service, and fetch its public URL.

Setup

uv pip install "nullspace-sdk[cli]==0.1.9"
export NULLSPACE_API_KEY=ns_live_...
export NULLSPACE_API_URL=https://api.your-nullspace-domain
cd examples/python/agent_deployments/minimal_service

CLI

nullspace agent deploy .

nullspace agent url minimal-service-agent \
  --env EXAMPLE_AGENT_GREETING=hello

nullspace agent status minimal-service-agent --service adsvc_123
nullspace agent logs minimal-service-agent --service adsvc_123
nullspace agent stop minimal-service-agent --service adsvc_123
nullspace agent delete minimal-service-agent --yes
The service binds to 0.0.0.0:8000, exposes /health, and uses permissions.public_url = true so nullspace agent url can return a public endpoint. Expected output includes a public URL, a ready service status, and a /health response with {"ok": true}.

Python

The companion run.py script uses the same deployment contract through the SDK:
from pathlib import Path

from nullspace import AgentDeployment

project = Path(__file__).resolve().parent
deployment, version, manifest = AgentDeployment.deploy(path=project)
service = deployment.start_service(envs={"EXAMPLE_AGENT_GREETING": "hello"})
url = deployment.service_url(service.id)
print(deployment.name, version.id, len(manifest.entries), url.public_url)
Run the complete script:
python run.py

Project Files

examples/python/agent_deployments/minimal_service/
  README.md
  server.py
  run.py
  nullspace.agent.toml
Related: Agent Deployments, Preview URLs, and CLI reference.