---
title: OpenRPC
sidebar:
  icon: file-json
description: Turn your procedures into an OpenRPC document you can inspect in the playground.
---

`toOpenRpc(router)` walks procedures into an [OpenRPC](https://spec.open-rpc.org/) document. Input/output schemas are used when the Standard Schema exposes `jsonSchema`; otherwise `true`. Methods list the JSON-RPC + app error codes.

Paste the document into the [OpenRPC Playground](https://playground.open-rpc.org/) to inspect methods and schemas.

```ts twoslash
import { tacho, toOpenRpc } from "tacho";

const rpc = tacho();
const router = rpc({ ping: rpc.run(() => "pong" as const) });
// ---cut---
const spec = toOpenRpc(router, {
  title: "My API",
  version: "1.0.0",
  servers: [{ url: "https://api.example.com" }],
});
```
