API Reference
The darkreach coordinator exposes a REST API and WebSocket endpoint for nodes, the dashboard, and third-party integrations. The API is organized into 12 endpoint groups covering all platform functionality.
Base URL: https://api.darkreach.ai
REST Endpoints
Primes
Query, filter, and inspect discovered primes.
/api/primesList discovered primes with pagination and filtering.
{
"primes": [
{
"id": 1,
"form": "factorial",
"expression": "147855! + 1",
"digits": 636919,
"proof_type": "pocklington",
"certificate": { ... },
"discovered_at": "2026-02-14T12:00:00Z"
}
],
"total": 2847,
"page": 1,
"per_page": 50
}/api/primes/:idGet a single prime with full certificate data.
/api/statsAggregate statistics: total primes, candidates tested, active workers.
{
"total_primes": 2847,
"candidates_tested": 14200000000,
"active_workers": 38,
"compute_hours": 127000,
"search_forms": 12
}Verification
Re-verify primes and inspect certificates.
/api/verifyRe-verify a prime through the 3-tier pipeline. Returns updated proof status.
{
"prime_id": 42,
"result": "verified",
"proof_type": "pocklington",
"certificate": { ... }
}Workers & Nodes
Worker registration, heartbeat, and node management.
/api/workersList all registered workers with status and last heartbeat.
/api/workers/registerRegister a new worker with the coordinator.
/api/workers/heartbeatWorker heartbeat with progress and status update.
/api/fleetFleet overview: all nodes, active searches, aggregate stats.
Operators
Operator accounts and node management (v1 API).
/api/v1/operatorsList operators with node counts, compute hours, and prime counts.
{
"operators": [
{
"id": "op-abc",
"name": "alice",
"contact_email": "alice@example.com",
"node_count": 4,
"total_compute_hours": 1200,
"primes_found": 23
}
]
}/api/v1/operatorsRegister a new operator account.
/api/v1/nodesList all nodes across all operators with status.
/api/v1/nodes/registerRegister a new node under an operator.
/api/v1/nodes/heartbeatNode heartbeat with system metrics and progress.
Search Jobs
Job lifecycle, work blocks, and search management.
/api/search_jobsList search jobs with status (running, completed, paused).
/api/search_jobsCreate a new search job.
/api/search_jobs/claimClaim the next available work block (FOR UPDATE SKIP LOCKED).
/api/search_jobs/:id/completeMark a work block as completed with results.
/api/searchesList active searches with progress and rate metrics.
/api/searchesStart a new search with form and range parameters.
AI Agents
Agent task management, budgets, memory, roles, and schedules.
/api/agents/tasksList agent tasks with status and assigned agent.
{
"tasks": [
{
"id": "task-123",
"title": "Optimize factorial sieve depth",
"status": "running",
"agent": "strategy-agent",
"created_at": "2026-02-20T10:00:00Z"
}
]
}/api/agents/tasksCreate a new agent task.
/api/agents/tasks/:idUpdate task status or assignment.
/api/agents/budgetsGet agent compute budgets and spend tracking.
/api/agents/budgetsSet or update an agent budget.
/api/agents/memoryRead agent memory key-value store.
/api/agents/memoryWrite to agent memory.
/api/agents/schedulesList agent automation schedules.
/api/agents/schedulesCreate or update a schedule.
Projects
Multi-phase campaign management.
/api/projectsList all projects with phase status and progress.
/api/projectsCreate a new project campaign.
/api/projects/:idGet project details with phases, events, and cost breakdown.
/api/projects/:idUpdate project configuration or budget.
/api/projects/:id/advanceManually advance to the next phase.
Observability
Metrics, logs, and performance monitoring.
/api/observability/metricsSystem metrics: CPU, memory, disk, and worker rates.
/api/observability/logsRecent system logs with filtering and pagination.
/api/observability/chartsTime-series data for performance charts.
Releases
Worker release channels and canary rollout control.
/api/releases/worker/latest?channel=stableGet latest worker release metadata for a channel.
{
"channel": "stable",
"version": "0.1.0",
"published_at": "2026-02-20T00:00:00Z",
"notes": "Initial public release",
"artifacts": [
{
"os": "linux",
"arch": "x86_64",
"url": "https://downloads.darkreach.ai/...",
"sha256": "..."
}
]
}/api/releases/workerUpsert a worker release record.
/api/releases/rolloutSet channel target version and rollout percentage.
/api/releases/rollbackRollback a channel to the previous version.
/api/releases/events?channel=stable&limit=100Audit trail of rollout and rollback events.
/api/releases/health?active_hours=24Release adoption summary by worker version.
Documentation
Documentation search and content serving.
/api/docsList all documentation files with titles and categories.
/api/docs/:slugGet a documentation file by slug.
/api/docs/search?q=queryMulti-word search across all docs with relevance ranking.
{
"results": [
{
"slug": "sophie-germain",
"title": "Sophie Germain Primes",
"snippets": [
{ "text": "...matching line...", "line": 42 }
],
"category": "roadmaps",
"score": 35
}
]
}/api/docs/roadmaps/:slugGet a roadmap document.
/api/docs/agent/:slugGet a CLAUDE.md agent file.
Notifications
Push notification management.
/api/notificationsList notification subscriptions.
/api/notifications/subscribeSubscribe to push notifications for prime discoveries.
Health & Status
Service health checks and coordinator status.
/api/healthHealth check and readiness probe.
/api/statusCoordinator status with uptime, version, and worker count.
{
"status": "healthy",
"version": "0.1.0",
"uptime_seconds": 86400,
"database": "connected",
"workers_online": 38,
"active_searches": 5,
"ai_engine": "running"
}WebSocket
Connect to wss://api.darkreach.ai/ws for real-time updates. Messages are JSON-encoded with an event field. The server pushes updates every 2 seconds.
prime_discoveredBroadcast when a new prime is found by any node.
{ "form": "factorial", "expression": "147855! + 1", "digits": 636919, "proof_type": "pocklington" }worker_statusFleet status update pushed every 2 seconds.
{ "workers": [...], "active_searches": [...], "total_rate": 150000 }search_progressSearch progress update with candidates tested and rate.
{ "job_id": 1, "progress": 0.42, "candidates_per_second": 15000 }ai_decisionAI engine decision notification with reasoning.
{ "action": "start_search", "form": "kbn", "confidence": 0.87, "reasoning": "..." }project_eventProject phase transition or milestone.
{ "project_id": "proj-1", "event": "phase_advance", "from": "scout", "to": "search" }subscribeSubscribe to specific event channels.
{ "channels": ["primes", "fleet", "searches", "ai", "projects"] }Authentication
The dashboard uses Supabase Auth (email/password) for login. API endpoints for read operations are currently unauthenticated. Write operations on the operator and agent APIs require an operator ID for identity. Node registration uses coordinator-assigned worker IDs.
Rate Limits
The API does not currently enforce rate limits. However, heartbeat endpoints are designed for 10-second intervals, and the WebSocket connection pushes at 2-second intervals. Excessive polling is discouraged.