Surveillance & Robotics
Pi exposes two purpose-built APIs for physical intelligence workloads: video surveillance for programmable scene understanding and robotics for agentic robot control. Both follow the same OpenAI-compatible async job pattern and support SSE event streams for real-time delivery.Video surveillance
Configure what to watch for, which behaviors trigger alerts, and how you want incidents delivered — Pi handles the perception pipeline internally.Submit a video analysis job
POST /api/v1/surveillance/streams creates an async job (202 Accepted) that runs perception, evaluates inline behaviors and stored policies, optionally narrates incidents with Gemini, and publishes incidents to SSE subscribers.
202)
Create and manage behavior policies
POST /api/v1/surveillance/policies stores a reusable policy scoped to a stream or globally (when stream_id is empty). Policies are evaluated alongside inline behaviors on every stream job.
Subscribe to the incident SSE stream
GET /api/v1/surveillance/events emits incident events as JSON and : heartbeat comments every 15 seconds. Filter by severity with ?severity=warning.
Built-in profiles
Pass aprofile to apply sensible defaults for your deployment type. Your explicit behaviors override the preset when non-empty.
| Profile | Typical use |
|---|---|
retail_security | Shop floor loitering, checkout crowding, unattended object proxy |
warehouse_safety | Forklift speed, one-way lanes, restricted storage |
smart_city | Crosswalk crowding, arterial speed, bus lane direction |
residential_perimeter | Night intrusion, driveway loitering |
construction_site | Hazard zone breach, scaffold crowding |
parking_lot | Row loitering, after-hours intrusion, lot speed |
school_campus | Cafeteria crowding, parking loitering, staff-only intrusion |
healthcare_facility | Patient wing dwell time, ER crowding, pharmacy perimeter |
Robotics
The Robotics API lets you run programmable robot behaviors (patrol, observe, follow) with HTTP calls. Pi orchestrates perception, behavior evaluation, and decisions via a ROS2 bridge sidecar.Start an agentic robot run
POST /api/v1/robots/run queues an async job (perception + behaviors + decisions).
202)
GET /api/v1/jobs/:id. Failures are captured in jobs.error_log.
Check robot status
GET /api/v1/robots/:id/status returns robot metadata and current state from the ROS2 bridge sidecar when available.
Send a direct command
POST /api/v1/robots/:id/command sends a command directly to the robot without queuing a full run.
Subscribe to robotics SSE events
GET /api/v1/robots/events streams real-time incident events from robot runs.
Stored configuration
Store reusable zones, behaviors, and action templates at the org level:| Method | Path | Purpose |
|---|---|---|
GET / POST | /api/v1/robots/zones | Define patrol and watch zones |
GET / POST | /api/v1/robots/behaviors | Register reusable behavior rules |
GET / POST | /api/v1/robots/actions | Register response action templates |