Install packages
Install the server and client packages. oRPC works with any schema validator — these examples use Zod.
Define your router
Create your procedures and group them into a router. The
os builder lets you chain .input(), .output(), and .handler() to define each operation.router.ts
Create your server
Pass your router to an
RPCHandler and attach it to a Node.js HTTP server (or any supported runtime).server.ts
oRPC supports Node.js, Cloudflare Workers, Deno, Bun, and any Fetch-compatible runtime. See the adapters section for all options.
Create your client
The client is fully typed from your router — no code generation required.
client.ts
Call your API
Call procedures as if they were local async functions. TypeScript will infer the input and output types automatically.
Next steps
Core concepts
Learn about procedures, routers, middleware, and context.
Server adapters
Deploy to Node.js, Cloudflare, Bun, Deno, and more.
Client setup
Connect from any frontend with full type safety.
OpenAPI
Generate OpenAPI specs and serve interactive API docs.
