Skip to content

REST API

All endpoints are prefixed with the server base URL (e.g., http://localhost:3000).

Authentication: pass Authorization: Bearer <jwt> or X-API-Key: al_<key> on all protected endpoints.

Create a new user account.

// Request
{ "email": "user@example.com", "password": "strongpassword" }
// Response 201
{ "id": "user_abc", "email": "user@example.com" }

Exchange credentials for a JWT.

// Request
{ "email": "user@example.com", "password": "strongpassword" }
// Response 200
{ "access_token": "eyJ...", "token_type": "bearer" }

Return current authenticated user info.

// Response 200
{ "id": "user_abc", "email": "user@example.com", "created_at": "2026-03-01T00:00:00Z" }

Generate a new API key for the authenticated user.

// Response 201
{ "key": "al_abc123...", "id": "key_xyz", "created_at": "2026-03-01T00:00:00Z" }

List all API keys for the authenticated user (keys are masked).

Revoke an API key.


Create a new trace.

// Request
{
"id": "trace_abc",
"agent_name": "ResearchAgent",
"status": "running",
"metadata": {}
}
// Response 201
{ "id": "trace_abc", "agent_name": "ResearchAgent", ... }

List traces with optional filters.

Query params:

ParamTypeDescription
searchstringFull-text search on agent_name and span names
statusstringrunning, success, error
agentstringFilter by agent_name
fromISO dateStart date filter
toISO dateEnd date filter
pageintPage number (default: 1)
page_sizeintResults per page (default: 20, max: 100)
sortstringcreated_at, duration, cost
orderstringasc, desc

Fetch a single trace with all spans.

Update trace status or metadata.

Add a span to an existing trace.

// Request
{
"id": "span_001",
"name": "web_search",
"kind": "tool_call",
"status": "success",
"input": { "query": "..." },
"output": { "results": [...] },
"cost_usd": 0.002,
"duration_ms": 340
}

Compare two traces.

Query params: a=<trace_id>&b=<trace_id>

Server-Sent Events stream for real-time span updates.

// Event types
data: {"type": "span_created", "trace_id": "...", "span": {...}}
data: {"type": "trace_updated", "trace": {...}}
data: {"type": "alert_fired", "alert": {...}}

Receive OTLP HTTP JSON spans. Accepts standard ExportTraceServiceRequest payload.


Create a new alert rule.

{
"name": "High cost",
"type": "cost_spike",
"threshold": 0.10,
"mode": "absolute",
"baseline_window": 10,
"cooldown_seconds": 60,
"webhook_url": "https://hooks.slack.com/..."
}

List all alert rules for the authenticated user.

Update an alert rule.

Delete an alert rule.


List fired alert events.

Query params: resolved=true|false, page, page_size

Mark an alert event as resolved.

{ "resolved": true }