Contract
Reference for oRPC contracts: describe procedures and routers without logic, implement them with type checking, generate them from OpenAPI, and scale clients.
A contract describes your API’s input, output, and errors without any logic. The server implements it with full type checking, and clients use it without importing server code. For a walkthrough, start with Contract-First.
- Procedure Contract: define one procedure with the
ocbuilder. - Router Contract: group procedure contracts, or derive a contract from a router.
- Contract Implementation: implement a contract with
implement. - Generate from OpenAPI: create a contract from an existing OpenAPI document.
- Contract Client Factory: build clients per procedure to keep large codebases fast.