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

What state changes

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

Usage

from nullspace import Machine

with Machine.create(template="base", timeout=300) as machine:
    print(machine.id)
    result = machine.commands.run("pwd", shell=True)
    print(result.stdout.strip())
nullspace machine create --template base --json
curl -fsS -X POST \
  -H "Authorization: Bearer ${NULLSPACE_API_KEY}" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-${USER}-$(date +%s)" \
  -d '{"template":"base","vcpus":2,"memory_mb":512,"timeout_ms":300000}' \
  "${NULLSPACE_API_URL}/v1/machines"
API reference: createMachine (POST /v1/machines). Guide: Machines. Example: Examples.