Navigation

API Reference

HamBros exposes a RESTful API for managing agent sessions, telemetry, factory operations, and more. All endpoints are served from the Express backend (default port 20001).

Base URL

http://localhost:20001/api

Authentication

All endpoints require authentication. Include one of:

MethodHeaderExample
API KeyX-Hammurabi-Api-KeyX-Hammurabi-Api-Key: hb_3f...
Auth0 JWTAuthorizationAuthorization: Bearer eyJ...

See Authentication for setup details.

Response Format

All endpoints return JSON. Successful responses use HTTP 200/201. Errors return appropriate status codes with a message:

{
  "error": "Session not found",
  "status": 404
}

API Sections

Agents API

Session management, message sending, streaming, and worker dispatch.

Commanders API

Commander CRUD, quest board, memory system, and heartbeat.

Command Room API

Scheduled task management, run history, and manual triggers.

Telemetry API

OTLP ingestion, cost summaries, session metrics, and data compaction.

Authentication

API key management, Auth0 configuration, and scope reference.

Health Check

GET /api/health

Returns server status and loaded modules:

{
  "status": "ok",
  "modules": ["agents", "telemetry", "services", "factory", "commanders", "command-room"]
}

WebSocket Endpoints

EndpointDescription
ws://host/api/agents/sessions/:nameStream agent session output
ws://host/api/services/:name/logsStream service logs

WebSocket connections require matching CORS origin configuration.