Web4Guru AI Operations

Remote Procedure Call (RPC)

Remote Procedure Call (RPC) is a protocol pattern where a client invokes a named procedure on a server with typed arguments and receives a typed result.

In plain English

RPC is "call a function on another machine as if it were local." You name the procedure, pass typed arguments, and get a typed result back. Under the hood, the call is serialized, sent over the network, executed on the server, and the result is serialized back. REST and GraphQL are RPC-adjacent; gRPC and JSON-RPC are explicit RPC protocols. tRPC, increasingly popular in TypeScript stacks, is RPC with shared types.

RPC shines when client and server share a domain vocabulary — you are not shaping resources and verbs around HTTP, you are just calling functions. The downside is coupling: the client needs to know the server's procedure names and shapes, which can be brittle across versions. In practice that is solved with a typed schema (Protocol Buffers, Zod, TypeScript) that both sides import.

Why it matters for Black Box

Black Box's API uses an internal RPC convention: POST /v1/rpc with a method-and-params body. The web app calls those procedures by name; server handlers live under apps/api/src/ in one subdirectory per module (workspace, oauth, billing, and so on). Types are shared across client and server.

Examples

  • Calling workspace.create with a name and receiving a workspace id.
  • Calling billing.subscribe with a plan and receiving a Stripe Checkout URL.
  • Calling settings.update with new defaults and receiving the updated record.

Related terms