Agents API — read-only registry of swarm agents.
Get a specific agent by ID.
List all agents registered for the tenant.
Claims API — extracted factual assertions.
Group a scope's claims by source document.
Returns an object mapping each source to its list of claims.
Create a claim (kernel → API after extracting from a document).
List claims extracted for a scope (newest-first).
Contradictions API — conflicting claim pairs.
Create a contradiction (comparator agent).
List contradictions detected for a scope (open/critical first).
Resolve or defer a contradiction (HITL).
Documents API — ingested source material.
Register a document (kernel after indexing).
List documents ingested into a scope (newest-first).
Update a document's status and/or claim_count.
Drifts API — confidence changes detected between rounds.
Create a drift (comparator agent).
List drifts detected for a scope (highest severity first).
Epochs API — per-round narrative summaries.
Add a HITL comment to an epoch summary. Returns the updated epoch summary (with the new comment appended).
Create an epoch summary (kernel at round completion).
Get the latest epoch summary for a scope.
List epoch summaries for a scope (newest-first).
ReadonlyeventsReal-time event transport (NATS).
Always present; active only when nats is in ClientConfig.
Call await client.connect() to establish the connection.
Throws NatsNotConfiguredError when accessed without NATS config.
Finality API — query convergence status and time-series history.
Get a finality certificate for a specific convergence round.
Get historical finality time-series data points (from DuckDB). Useful for convergence trend charts.
Get current finality status for a scope.
Upsert finality status (called by the convergence kernel after each round). Also appends a DuckDB time-series snapshot server-side.
Verify a finality certificate signature.
Health check — no auth or tenant header required.
Ingest API — public product entrypoint into the headless swarm.
Models API Connect and manage LLM model providers
Connect a new model provider and store its API key encrypted at rest. The plaintext key is never returned after this call — only the handle.
Get a connected model handle (no API key in response).
List all connected model handles for the tenant.
Revoke a model handle (permanently removes the encrypted key).
Risks API — identified risk items.
Create a risk (risk-assessment agent).
List risks identified for a scope (critical first).
Scopes API Manage governance scopes and their lifecycle
Create a new scope.
The caller supplies the scope id — a human-readable slug (lowercase
a-z, 0-9, hyphens; e.g. acme-vendor-acquisition). This matches the
server contract: POST /api/scopes requires id in the request body.
Delete a scope.
Get a specific scope by ID.
List all scopes for the configured tenant.
Partial update of an existing scope.
Full replace of an existing scope.
Close the NATS connection, draining in-flight messages. Safe no-op when NATS is not configured or not connected.
Connect the NATS real-time transport.
Safe no-op when nats is not in ClientConfig.
Must be called before using client.events subscriptions.
SGRS REST API client for TypeScript.
All request and response types are validated against the Zod schemas defined in @sgrs/api-schema, ensuring type safety and runtime validation.
Usage: const client = new Client({ baseUrl: 'http://localhost:3003' }); const scopes = await client.scopes.list(); const scope = await client.scopes.get('my-scope');