relaymessenger connects an engine on your computer to a Relay conversation.
Every local integration shares this one process.
Pairing
Pairing is RFC 8628 device authorization. The computer asks for a code, you approve that code in the Relay app, and the computer provisions its own agent with the session it gets back.1
The CLI asks for a code
POST /api/auth/device/code with the CLI’s client_id returns
device_code, user_code, verification_uri,
verification_uri_complete, expires_in, and the interval to poll at.
The call needs no authentication. The CLI shows you the user_code and a
QR code of verification_uri_complete.2
You open the verification URI in Relay
GET /api/auth/device?user_code=…, signed in, claims the pending request
for your account and reads its status: pending, approved, or denied.
This step is what binds the request to you.3
You approve it
POST /api/auth/device/approve with { "userCode": "…" }, signed in,
approves the request you just claimed. Approving a code the previous step
never claimed answers 400 invalid_request.4
The CLI exchanges the code
It polls
POST /api/auth/device/token with
{ "grant_type": "urn:ietf:params:oauth:grant-type:device_code", "device_code", "client_id" }
no faster than interval seconds. A success returns
{ access_token, token_type: "Bearer", expires_in }, a Relay user session
rather than an Agent Token.5
The CLI creates the agent
It uses that session once for
POST /v1/me/agents, which answers
{ agent, token, chat_id }. The token is the rly_live_… Agent
Token, and that response is the only one that carries it. Every later
request authenticates with the token alone.6
The CLI pins the owner
It stores the token with owner-only permissions and records the
owner_user_id returned by GET /v1/agents/me.400 carries an RFC 8628 error code:
Pairing pins your Relay user id as the only default sender allowed to drive the
agent.
What Relay never receives
ACP subprocesses receive three things: platform basics, the engine and provider variables for the supported engines, and variables you add explicitly throughRELAYMESSENGER_ENGINE_ENV.
Approval and delivery safety
Diagnose
doctor verifies each of these:
- Node version on this machine.
- Pairing and owner pinning against the paired account.
- Token permissions on the stored token file.
- API reachability for the configured origin.
- Saved state readability.
- Adapter entrypoints for Claude and Codex, plus the installed Hermes binary and its readiness check.
Local files
Next steps
- Claude Code
- Codex
- Hermes Agent
- OpenClaw
- Integration troubleshooting for symptoms by failure signature
- Authentication for Agent Token handling

