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.
| Surface | Purpose |
|---|---|
/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/auth — apps/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
| Concern | Location |
|---|---|
| Router and procedures | packages/api/src/orpc/router.ts |
| Request logging | packages/api/src/orpc/logging.ts |
| Control-plane operations | packages/api/src/control-plane.ts |
| Access rules | packages/api/src/access.ts |
| RPC transport route | apps/dashboard/server/routes/rpc/[...].ts |
| OpenAPI transport route | apps/dashboard/server/api/v1/[...].ts |
| Aggregate dashboard view | packages/api/src/orpc/router.ts (dashboard.overview) |
| GitHub webhook ingress | apps/dashboard/server/routes/webhooks/github.post.ts |
What is Agent Zero?
Agent Zero is an open-source autonomous engineer that finds, fixes, and verifies problems in pull requests.
Define endpoints
Procedures are defined once in packages/api/src/orpc/router.ts and served over both transports automatically. Before changing routes, read the orpc-server Agent Skill.