Expand description
The Messages API a Claude relay talks to: deterministic, no model.
A relay (crate::claude_relay) is a real Claude Code process, because
only a live Claude peer’s SendMessage gets a Claude session’s reply back.
What it asks its model is always the same: send the queued message. So a
relay’s ANTHROPIC_BASE_URL points here, and this endpoint answers as the
model would, from the relay’s own queue:
- a send turn gets one
SendMessagetool call carrying the queuedtoandmessage, byte for byte; - the turn after a tool result, or with nothing queued, gets
RELAY_STATUS_LINEand ends.
No model runs and nothing is billed. The gate hook still checks every tool
call against the queue, and the receipt is still Claude’s own
SendMessage result. A relay’s API key names its directory under
<mail root>/relays/.
The machine daemon’s supercode message watch child serves it on
loopback, on the port recorded in <mail root>/relay-endpoint.json (a
restarted server binds the same port again, so running relays keep it).
Functions§
- relay_
endpoint_ url - The endpoint’s base URL, when it is answering.
- serve_
relay_ endpoint - Serve the endpoint until the process ends.