API

API overview

Agent Zero exposes one typed router — rpcRouter from packages/api — served over two wire protocols by the dashboard's Nitro server. Authorization behaves identically either way, because both transports serve the exact same procedures.

Agent Zero exposes one typed router — rpcRouter from packages/api — served over two wire protocols by the dashboard's Nitro server. Authorization behaves identically either way, because both transports serve the exact same procedures.

SurfacePurpose
/rpc/**Typed oRPC router: health, dashboard.overview, tasks.list/get/create, approvals.decide
/api/v1/**The same router over OpenAPI/REST; interactive docs at /api/v1/docs, spec at /api/v1/openapi.json
/api/auth/**The Better Auth handler (see Authentication)

The API package

packages/api is the library the dashboard's server reads from: it composes the agent runtime, source-control adapter, model abstraction, and config into the typed oRPC router and a control-plane operations layer (runTask, TaskScheduler, TaskStore). It holds no HTTP host of its own and does not depend on packages/authapps/dashboard/server/ is the only place that constructs a transport handler from it.

Procedures validate at the boundary with Zod and then delegate; they never invoke a shell or touch a checkout, because runTask is the only place that resolves policy and constructs a runner.

Scheduling

TaskScheduler bounds work globally and per repository, so a burst queues instead of fanning out unbounded runs, and rejects work once the queue is exhausted rather than growing without limit.

Where things live

ConcernLocation
Router and procedurespackages/api/src/orpc/router.ts
Request loggingpackages/api/src/orpc/logging.ts
Control-plane operationspackages/api/src/control-plane.ts
Access rulespackages/api/src/access.ts
RPC transport routeapps/dashboard/server/routes/rpc/[...].ts
OpenAPI transport routeapps/dashboard/server/api/v1/[...].ts
Aggregate dashboard viewpackages/api/src/orpc/router.ts (dashboard.overview)
GitHub webhook ingressapps/dashboard/server/routes/webhooks/github.post.ts
Copyright © 2026