Documentation
Authentication
All API requests require a valid API key passed via the Authorization header or the x-api-key header. Keys are generated from the LifeOS dashboard and can be scoped to specific layers, agents, or operations.
curl -H "Authorization: Bearer lf_abc123def456" \ https://api.lifeos.app/api/health
REST Endpoints
Base URL: https://api.lifeos.app (production) or http://localhost:8787 (local)
MCP Tools
LifeOS exposes a set of MCP (Model Context Protocol) tools that AI agents can invoke directly. These tools provide structured access to layer data, currency scores, and agent lifecycle operations.
WebSocket Streams
Subscribe to real-time updates from the LifeOS event bus. The WebSocket endpoint is at wss://api.lifeos.app/ws. Events are emitted when agents complete reflections, currency scores update, or layer syncs finish. Each event includes a type, timestamp, and payload.
layer.synced — A layer finished syncing with Notion currency.updated — A currency score was modified agent.reflection — An agent completed its reflection cycle system.health — Periodic system health status
Client Libraries
Official TypeScript client library is available for integrating LifeOS into your own projects. The client handles authentication, retries, and provides typed interfaces for all endpoints and MCP tools.
import { LifeOSClient } from '@lifeos/sdk';
const client = new LifeOSClient({ apiKey: 'lf_...' });
const layers = await client.getLayers();