Navigation

Services Manager

The Services module provides API key management with encrypted storage, service health monitoring, and system metrics.

Overview

┌──────────────────────────────────────────────┐
│  Services Manager                             │
├──────────────────────────────────────────────┤
│                                               │
│  API Keys                                     │
│  ┌──────────────────────────────────────────┐│
│  │ Name      │ Prefix  │ Scopes   │ Status  ││
│  │ prod-key  │ hb_3f.. │ all      │ active  ││
│  │ read-only │ hb_a1.. │ *:read   │ active  ││
│  └──────────────────────────────────────────┘│
│                                               │
│  System Health                                │
│  ┌──────────────────────────────────────────┐│
│  │ CPU: 23%  │ Memory: 4.2GB  │ Disk: 67%  ││
│  └──────────────────────────────────────────┘│
└──────────────────────────────────────────────┘

API Key Management

Creating Keys

Create scoped API keys through the dashboard or API:

POST /api/auth/keys
{
  "name": "ci-pipeline",
  "scopes": ["agents:read", "agents:write", "telemetry:write"]
}

Returns the full key (shown only once) and a key prefix for identification.

Available Scopes

ScopeDescription
agents:readView sessions and agent data
agents:writeCreate, message, and kill sessions
telemetry:readView telemetry data and summaries
telemetry:writeIngest telemetry events
factory:readView repos and worktrees
factory:writeClone repos, create worktrees
services:readView API keys and service status
services:writeCreate and revoke API keys
commanders:readView commander data and quests
commanders:writeManage commanders, quests, memory

Encrypted Storage

API keys are encrypted at rest using the HAMMURABI_SETTINGS_ENCRYPTION_KEY environment variable. If not set, a key is auto-generated on first boot and stored locally.

Listing and Revoking

# List keys (returns name, prefix, scopes — not the full key)
GET /api/auth/keys

# Revoke a key
DELETE /api/auth/keys/:id

Service Discovery

The Services module discovers and monitors running services:

# List services with health status
GET /api/services/list

# Check specific service health
GET /api/services/:name/health

# Get system metrics
GET /api/services/metrics

# Restart a service
POST /api/services/:name/restart

Log Streaming

Stream service logs in real-time via WebSocket:

ws://localhost:20001/api/services/:name/logs

OpenAI Transcription Key

For voice input features, configure an OpenAI API key:

# Check status
GET /api/auth/transcription/openai

# Set key
PUT /api/auth/transcription/openai
{ "apiKey": "sk-..." }

# Remove key
DELETE /api/auth/transcription/openai