middleapi/orpc has 5,750 GitHub stars and 175 forks. GitHot measured +2 stars in 24 hours and +15 in 7 days. Last checked 2026-11-04 23:13 UTC. Last push 2026-11-03.
Typesafe APIs Made Simple 🪄
Measured star growth
- in 24h
- +2
- in 7 days
- +15
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginaloRPC - Typesafe APIs Made Simple 🪄
oRPC is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more.
Define procedures on the server and serve them with an RPC handler:
import { os } from '@orpc/server'
import * as z from 'zod'
export const router = {
planet: {
find: os
.input(z.object({ id: z.number() }))
.handler(({ input }) => ({ id: input.id, name: 'Earth' })),
},
}
Then call them from a client that knows every input and output, without generating anything:
import type { RouterClient } from '@orpc/server'
import type { router } from './router'
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/fetch'
const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' })
const client: RouterClient<typeof router> = createORPCClient(link)
const planet = await client.planet.find({ id: 1 }) // { id: number, name: string }
Documentation
Read the full documentation at orpc.dev, starting with the Getting Started guide.
Packages
Core
| Package | Purpose | Docs |
|---|---|---|
| @orpc/contract | Define API contract as the single source of truth. | Procedure Contract, Contract Router, Implementation, Generate from OpenAPI |
| @orpc/server | Build APIs or implement contracts. | Procedure, Router, Middleware, Context, RPC Handler |
| @orpc/client | Consume APIs with end-to-end type safety. | Client-Side Clients, Server-Side Clients, RPC Link, Error Handling |
| @orpc/openapi | Add OpenAPI compatibility to APIs. | OpenAPI Handler, OpenAPI Link, Specification, Scalar |
Schema validation
| Package | Purpose | Docs |
|---|---|---|
| @orpc/zod | JSON Schema converter for Zod. | Zod |
| @orpc/valibot | JSON Schema converter for Valibot. | Valibot |
| @orpc/arktype | JSON Schema converter for ArkType. | ArkType |
Built-in features
| Package | Purpose | Docs |
|---|---|---|
| @orpc/publisher | Pub/Sub with memory, Redis, and Upstash adapters. | Publisher |
| @orpc/ratelimit | Rate limiting with memory, Redis, and Upstash adapters. | Rate Limit |
| @orpc/experimental-lock | Locking with memory, Redis, and Upstash adapters. | Lock |
| @orpc/hibernation | Leverage Hibernation APIs like Cloudflare's Hibernation WebSocket. | Hibernation |
| @orpc/json-schema | Smart coercion for OpenAPI requests. | Smart Coercion |
Framework & ecosystem integrations
| Package | Purpose | Docs |
|---|---|---|
| @orpc/next | Integrate with Next.js Server Functions. | Next.js |
| @orpc/ai-sdk | Turn contracts and procedures into AI SDK tools. | AI SDK |
| @orpc/mcp | Expose procedures as MCP tools. | MCP |
| @orpc/tanstack-query | Integrate with TanStack Query. | TanStack Query |
| @orpc/pinia-colada | Integrate with Pinia Colada. | Pinia Colada |
| @orpc/swr | Integrate with SWR. | SWR |
| @orpc/msw | Mock procedures with Mock Service Worker. | MSW |
| @orpc/effect | Integrate with Effect. | Effect |
| @orpc/nest | Implement your contract with NestJS. | NestJS |
| @orpc/node | Node.js plugins for static file serving and large uploads. | Static File, Tmp File Upload, Batch Response Compression |
| @orpc/bun | Adapters for Bun's Redis. | Publisher, Rate Limit, Lock |
| @orpc/cloudflare | Adapters for Cloudflare Workers. | Publisher, Rate Limit, Lock, Traces |
| @orpc/trpc | Reuse existing tRPC routers within oRPC. | tRPC |
Observability
| Package | Purpose | Docs |
|---|---|---|
| @orpc/opentelemetry | Integrate with OpenTelemetry for distributed tracing. | OpenTelemetry |
| @orpc/pino | Integrate with Pino for logging. | Pino |
| @orpc/evlog | Integrate with Evlog for logging. | Evlog |
Sponsors
Like what we build over at middleapi? You can help keep it going through GitHub Sponsors or Open Collective. Every bit helps! 🚀
The screenshot API for developers |
We're hiring NYC based engineers |
MisskeyHQDecentralized microblogging SNS born on Earth |
Organization Sponsors
LN Markets |
Sponsors
Backers
With thanks to 40 past sponsors who helped get oRPC here.
Open Source Programs
middleapi is supported by these open source programs:
Claude |
Pullfrog |
References
oRPC is inspired by existing solutions that prioritize type safety and developer experience. Special acknowledgments to:
- tRPC: For pioneering the concept of end-to-end type-safe RPC and influencing the development of type-safe APIs.
- ts-rest: For its emphasis on contract-first development and OpenAPI integration, which have greatly inspired oRPC's feature set.
License
Distributed under the MIT License. See LICENSE for more information.
Explore related projects
freeCodeCamp/freeCodeCamp
freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.
458,550 starsdonnemartin/system-design-primer
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
376,819 starsreact/react
The library for web and native user interfaces.
251,960 starsvuejs/vue
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
212,490 stars
MisskeyHQ