Skip to main content
oRPC

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:
PackageDescription
@orpc/serverBuild your API — define procedures, routers, middleware
@orpc/contractDefine your API contract (contract-first development)
@orpc/clientConsume your API on the client with full type safety
@orpc/openapiGenerate OpenAPI specs and serve OpenAPI-compatible handlers
@orpc/tanstack-queryTanStack Query integration (React, Vue, Solid, Svelte, Angular)
@orpc/reactReact utilities and Server Actions support
@orpc/otelOpenTelemetry instrumentation
@orpc/nestDeep NestJS integration
@orpc/zodExtended Zod schemas for OpenAPI
@orpc/valibotValibot → OpenAPI schema conversion
@orpc/arktypeArkType → 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.

Build docs developers (and LLMs) love