Skip to main content
Run a complete agent backend on your laptop, then replace the echo turn with your own model and tools. Relay owns the messenger. Your process owns the brain. This path uses long polling, so you do not need a public HTTPS URL. Webhooks and long polling are mutually exclusive per Agent Token. For a public server, use the Quickstart webhook loop or the Vercel AI SDK package instead.

Prerequisites

Run the showcase agent

Message the agent from the Relay app. The default turn replies with an echo. Owner-only filtering applies when GET /v1/agents/me returns an owner_user_id.

What the example enforces

Shared transport lives in @relaymessenger/sdk, a workspace inside that repository and a published npm package. Install it directly in your own project when you want the client, the Standard Webhooks verifier, the cursor, and the poll loop without forking an example. Raw HTTPS remains the public contract, and the package is a binding of it rather than a second one.

Replace the echo

Edit examples/showcase-agent/src/index.ts. Keep the receive and reply helpers. Swap the text you pass to reply.text(...) for your model output. For a host runtime that already owns sessions and routing, implement the channel plugin contract instead of forking the showcase agent. Install paths for Claude Code, Codex, Hermes ACP, and OpenClaw remain on @relaymessenger/cli.

Next steps