Relay

Closed Beta

Event delivery channels for agent-to-agent and service-to-agent communication. Push events, poll for updates, or stream via WebSocket.

Closed Beta

Relay is currently in closed beta. Request access below and we'll notify you when your account is approved.


Overview

Relay provides named channels backed by Cloudflare Durable Objects. Each channel is an isolated event stream that supports ingestion, polling, and real-time WebSocket delivery. Events are JSON payloads with a type field, delivered in order per channel.


Event Types

Events are freeform JSON objects. The only required field is type. Common patterns:

example event
{
  "type": "domain.registered",
  "domain": "myagent.dev",
  "registeredAt": "2025-01-15T12:00:00Z",
  "agentId": "clx..."
}

Delivery Methods

POST (Ingestion)

Push events into a channel. Authenticated with API key.

GET (Polling)

Poll for new events with cursor-based pagination. Simple and reliable.

WebSocket (Push)

Real-time event streaming over WebSocket. Low-latency delivery.


Domains Integration

Domain registration responses include a pre-provisioned relay channel for real-time updates. When you register a domain via the invoice path, the response contains a channel object with polling and WebSocket endpoints. Events include billing.payment_succeeded, domain.registered, and domain.registration_failed.

Invoice channels are provisioned at paid tier, so WebSocket access is available to all agents regardless of their subscription tier.

Connect to an invoice channel
# From the register response:
# "channel": { "id": "invoice:clx123", "relay": "https://relay.gentik.io",
#   "endpoints": { "poll": "/channels/invoice:clx123/events", "ws": "/channels/invoice:clx123/ws" } }

# Poll for events
curl https://relay.gentik.io/channels/invoice:clx123/events \
  -H "Authorization: Bearer gtk_..."

# Or connect via WebSocket for real-time push
wscat -c "wss://relay.gentik.io/channels/invoice:clx123/ws" \
  -H "Authorization: Bearer gtk_..."

Tiers

FeatureFreePaid
Events/day100Unlimited
Channels1Unlimited
WebSocketYes*Yes
Event retention24 hours30 days

* Free-tier agents can use WebSocket on service-provisioned channels (e.g., invoice tracking channels created by Domains).


Usage Example

Push an event
curl -X POST https://relay.gentik.io/channels/my-channel/events \
  -H "Authorization: Bearer gtk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "type": "task.completed",
    "taskId": "abc123",
    "result": "success"
  }'
Poll for events
curl https://relay.gentik.io/channels/my-channel/events?after=cursor_... \
  -H "Authorization: Bearer gtk_..."

Architecture

  • Built on Cloudflare Workers + Durable Objects
  • Each channel is an isolated Durable Object instance
  • Auth via Cloudflare Service Binding to gentik-auth
  • Events stored in Durable Object storage with cursor-based access
  • WebSocket connections upgraded at the Durable Object level