What it is
Allternit API is the data-plane runtime built fromcmd/allternit-api. It owns per-tenant workspace state: agent sessions, Office bindings, beta research sessions, local files, and the rest of the node-affine /api/v1 surface.
It is not the public API.
Production browsers never open port 8013. They call the Cloud API, which relays to a paired or provisioned node. See API Overview.
Deployment modes
The same binary runs in three modes (architecture decision):- Local — inside Allternit Desktop on the user’s machine. Default developer loop:
cargo run -p allternit-apiorpnpm dev:platform-stack(API:8013, UI:3013, Gizzi:4096). - User-paired — on a VPS or homelab box the user controls. The node creates an Ed25519 pairing, the human approves it in the console, then
agent-daemonkeeps an outbound WebSocket to the Cloud API. - Allternit-provisioned — Cloud API creates an isolated instance per subscription. The init script installs Allternit API, SQLite under a per-instance data dir, and auto-pairs with a one-time bootstrap token. No inbound ports on the fleet host.
Local development
https://api.allternit.com/api/v1/health.
Override the bind with ALLTERNIT_API_PORT. Point the desktop/web fallback at this origin only when you are on the same machine (or a tunnel you control). Production VITE_ALLTERNIT_GATEWAY_URL stays https://api.allternit.com.
What production clients actually call
Node-affine namespaces are mounted on the Cloud API and relayed to this binary:
Relay rules:
- Clerk session required on the Cloud API.
- The Cloud API forwards the original
Authorizationheader. - HTTP 428 if the account has no healthy node (pair or start an instance).
- SSE and WebSocket streams are not buffered in the control plane.
Pairing a node
A user-paired or provisioned node does not expose 8013. It phones home:POST https://api.allternit.com/api/v1/runtime-pairingswith the node’s Ed25519 public key.- Human approves the user code at
https://platform.allternit.com/pair. - Node exchanges the pairing for a device token (
allternit_runtime_…). agent-daemonconnectswss://api.allternit.com/api/v1/runtime-relay/connect/:id.- Heartbeats keep the node in the default-node set (recent
last_seen).