Documentation

Auth

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.

Example Request
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)

GET /api/layers List all 5 layers with current currency scores
GET /api/layers/:id Get a specific layer's full data and history
POST /api/layers/:id/sync Trigger a Notion sync for a specific layer
GET /api/currencies List all 9 currencies with current balances
GET /api/agents List configured agents and their status
POST /api/agents/:id/trigger Manually trigger an agent run
GET /api/health System health check endpoint

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.

read_layer Read a layer's Notion database contents
write_observation Write an agent observation to a layer
update_currency Update a currency score for a given layer
get_briefing Generate a daily briefing from current state
trigger_reflection Trigger an agent's reflection cycle
query_insights Query aggregated insights across layers
Real-time

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.

Event Types
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
SDK

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.

Quick Example
import { LifeOSClient } from '@lifeos/sdk';

const client = new LifeOSClient({ apiKey: 'lf_...' });
const layers = await client.getLayers();