Arbiter

REST API & Streaming Reference

Exhaustive endpoint documentation for Arbiter REST API, SSE events, and NDJSON streaming.

REST API & Streaming Reference

Arbiter exposes a complete, typed REST API under http://127.0.0.1:8765/api/v1. By default, the API binds strictly to 127.0.0.1 for local safety.


Health & Discovery Endpoints

GET /health

Returns the status, server name, and active version of the Arbiter daemon.

  • Response: {"status": "ok", "name": "Arbiter", "version": "0.5.0"}

GET /.well-known/agent-card.json

Returns the standardized Agent-to-Agent (A2A) Agent Card declaring Arbiter's skills and task endpoints.


Ports Endpoints (/api/v1/ports)

MethodEndpointDescription
GET/api/v1/portsList all active host TCP listening ports and correlated process/Docker owners.
GET/api/v1/ports/freeFind count free host ports in the configured or requested range (?start=3000&end=4000&count=5).
GET/api/v1/ports/conflictsDetect collisions across registered project declarations and live host sockets.
POST/api/v1/ports/suggestSuggest the nearest free port at or above {"preferred_port": 3000}.
GET/api/v1/ports/{port}Inspect process or Docker container owning a specific port (or {"available": true}).

Projects Endpoints (/api/v1/projects)

MethodEndpointDescription
GET/api/v1/projectsList all registered development projects.
POST/api/v1/projectsRegister a new project by path ({"path": "/home/user/dev/app"}).
POST/api/v1/projects/scanScan configured PROJECT_ROOTS up to PROJECT_SCAN_DEPTH for projects.
GET/api/v1/projects/{id}Inspect registered project metadata, compose files, and detected ports.
DELETE/api/v1/projects/{id}Unregister project from SQLite database without deleting any files.
GET/api/v1/projects/{id}/workspaceGet workspace topology graph specific to the project.
GET/api/v1/projects/{id}/portsList ports declared across the project's Compose services.
GET/api/v1/projects/{id}/servicesList all Compose service names in the project.
GET/api/v1/projects/{id}/environmentGet resolved environment key-value pairs for the project.
GET/api/v1/projects/{id}/statusDiagnose project status, stopped containers, and missing variables.
GET/api/v1/projects/{id}/reconciliation-planGenerate dry-run port conflict resolution plan.
POST/api/v1/projects/{id}/preparePropose port conflict reconciliation and create safety approval.
POST/api/v1/projects/{id}/startPropose starting project containers via Compose.
POST/api/v1/projects/{id}/stopPropose stopping project containers.
POST/api/v1/projects/{id}/restartPropose restarting project containers.

File Editor Endpoints (/api/v1/projects/{id}/files)

MethodEndpointDescription
GET/api/v1/projects/{id}/filesList editable configuration files (.env*, compose*.yaml, Makefile, Dockerfile*).
GET/api/v1/projects/{id}/files/content?path=...Read configuration file content and SHA-256 hash.
POST/api/v1/projects/{id}/files/previewPreview unified diff and secret-masked changes.
POST/api/v1/projects/{id}/files/saveStage reviewed file save with expected_sha256 verification.
POST/api/v1/projects/{id}/files/undoUndo latest managed edit from automatic backup.

Makefile & Dockerfile Endpoints

MethodEndpointDescription
GET/api/v1/projects/{id}/make/targetsList parsed Makefile targets, comments, and risk levels.
GET/api/v1/projects/{id}/make/targets/{target}Inspect specific Make target and commands.
POST/api/v1/projects/{id}/make/targets/{target}/runPropose running a Make target in project directory.
GET/api/v1/projects/{id}/dockerfilesInspect Dockerfile base images, exposed ports, and multi-stage builds.

Docker & Compose Endpoints

MethodEndpointDescription
GET/api/v1/containersList all local Docker containers with Compose metadata.
GET/api/v1/containers/{id}Inspect detailed container properties and port mappings.
GET/api/v1/containers/{id}/logs?tail=200Stream recent container log lines on demand.
GET/api/v1/containers/{id}/statsFetch one-shot CPU, memory, and network metrics.
POST/api/v1/containers/{id}/startPropose starting a stopped container (LOW_RISK).
POST/api/v1/containers/{id}/stopPropose stopping a container (LOW_RISK).
POST/api/v1/containers/{id}/restartPropose restarting a container (LOW_RISK).
GET/api/v1/imagesList Docker images.
DELETE/api/v1/images/{id}Propose image removal (HIGH_RISK).
GET/api/v1/volumesList Docker volumes.
DELETE/api/v1/volumes/{id}Propose volume removal (DESTRUCTIVE).
GET/api/v1/networksList Docker networks.
GET/api/v1/docker/disk-usageGet Docker disk usage breakdown across images, volumes, and cache.
GET/api/v1/compose/projectsList Compose projects grouped by project label and working directory.
POST/api/v1/compose/projects/{id}/validateValidate Compose file syntax with compose config.
POST/api/v1/compose/projects/{id}/services/{service}/restartRestart a specific Compose service container.
POST/api/v1/compose/projects/{id}/services/portRewrite host port binding in Compose file and recreate service.

Multi-Project Stacks Endpoints (/api/v1/stacks)

MethodEndpointDescription
GET/api/v1/stacksList all stack presets.
POST/api/v1/stacksCreate a new multi-project stack preset.
POST/api/v1/stacks/seed-defaultsSeed default environment stack presets if empty.
GET/api/v1/stacks/activeGet the currently running stack preset.
GET/api/v1/stacks/{id}Inspect a stack preset by ID or name.
PUT/api/v1/stacks/{id}Update stack metadata, projects, or tags.
DELETE/api/v1/stacks/{id}Delete a stack preset from database.
GET/api/v1/stacks/{id}/boot-orderCompute DAG boot plan using Kahn's algorithm.
GET/api/v1/stacks/{id}/readinessEvaluate live readiness gates (tcp_port, http_get, docker_health).
POST/api/v1/stacks/{id}/readiness/authorizationsRequest operator approvals for non-local readiness gates.
GET/api/v1/readiness/authorizationsList persisted readiness destination grants.
DELETE/api/v1/readiness/authorizations/{id}Revoke a readiness grant.
POST/api/v1/stacks/{id}/switchPropose 1-click context switch to target stack.
POST/api/v1/stacks/{id}/stopPropose stopping/hibernating active stack containers.

Config & Secrets Intelligence Endpoints

MethodEndpointDescription
GET/api/v1/config-driftGlobal port drift and missing environment variable audit.
GET/api/v1/projects/{id}/config-driftConfig drift audit for a specific registered project.

Topology & Search Endpoints

MethodEndpointDescription
GET/api/v1/topologyFetch complete live machine topology graph (?project=name).
GET/api/v1/topology/project/{id}Fetch topology scoped to a single project.
GET/api/v1/resources/{type}/{id:path}Inspect a resource and its direct neighbors.
GET/api/v1/search?q=...&limit=30Keyword search across all topology nodes.
POST/api/v1/intelligence/filterNatural language resource query filter plan.

Safety & Approvals Endpoints (/api/v1/approvals)

MethodEndpointDescription
GET/api/v1/approvalsList all pending and historical safety approvals.
GET/api/v1/approvals/{id}Inspect approval payload, arguments, and time-travel visual diff.
POST/api/v1/approvals/{id}/approveApprove and execute stored action payload with verification.
POST/api/v1/approvals/{id}/rejectReject a pending safety approval.
GET/api/v1/actionsQuery immutable audit log of executed actions and verification results.
POST/api/v1/impactCompute pre-execution impact analysis for an action.

Streaming Endpoints

1. Activity Stream (Server-Sent Events)

  • Endpoint: GET /api/v1/events/stream
  • Media Type: text/event-stream
  • Description: Real-time stream of Docker lifecycle events (container start, stop, die, destroy) and host process observations.

2. AI Agent Query Stream (NDJSON)

  • Endpoint: POST /api/v1/agent/query/stream
  • Media Type: application/x-ndjson
  • Request Body: {"message": "What is using port 5432?"}
  • Description: Streams typed agent execution events (phase, routing, tool_call_start, tool_call_end, message, error) with sanitized traces and markdown text deltas.

On this page