What is oRPC?
oRPC is a powerful combination of RPC and OpenAPI, making it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards. Define your procedures once in TypeScript and get fully typed clients, automatic OpenAPI spec generation, and seamless framework integrations — all without any code generation step. oRPC is inspired by tRPC and ts-rest, combining the best of both: the ergonomics of RPC with the standards-compliance of OpenAPI.Key features
End-to-End Type Safety
Ensure type-safe inputs, outputs, and errors from client to server without any code generation.
First-Class OpenAPI
Built-in support that fully adheres to the OpenAPI standard, with automatic spec generation.
Contract-First Development
Optionally define your API contract before implementation, then share it with clients.
Standard Schema Support
Works out of the box with Zod, Valibot, ArkType, and any Standard Schema-compatible library.
Framework Integrations
Integrates with TanStack Query, SWR, Pinia Colada, and more for seamless data fetching.
Server Actions
Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
Streaming & SSE
Full type-safe support for Server-Sent Events and streaming responses.
Multi-Runtime Support
Fast and lightweight on Cloudflare Workers, Deno, Bun, Node.js, and beyond.
Packages
oRPC is a monorepo of focused packages. Install only what you need:| Package | Description |
|---|---|
@orpc/server | Build your API — define procedures, routers, middleware |
@orpc/contract | Define your API contract (contract-first development) |
@orpc/client | Consume your API on the client with full type safety |
@orpc/openapi | Generate OpenAPI specs and serve OpenAPI-compatible handlers |
@orpc/tanstack-query | TanStack Query integration (React, Vue, Solid, Svelte, Angular) |
@orpc/react | React utilities and Server Actions support |
@orpc/otel | OpenTelemetry instrumentation |
@orpc/nest | Deep NestJS integration |
@orpc/zod | Extended Zod schemas for OpenAPI |
@orpc/valibot | Valibot → OpenAPI schema conversion |
@orpc/arktype | ArkType → OpenAPI schema conversion |
Get started
Quickstart
Get up and running with oRPC in under 5 minutes.
Why oRPC?
Learn how oRPC compares to tRPC, ts-rest, and similar tools.
Core Concepts
Understand procedures, routers, middleware, and context.
GitHub
Explore the source code and contribute.