AgentsWebSocket Protocol

WebSocket Protocol

Connection

wss://api.conyr.ai/ws

Requires Authorization: Bearer <key>. The Free tier is rejected — /ws is a paid feature. Per-tier connection caps apply (connections per key: Free 0, Layer 1 5, Layer 2 20, Layer 3 50, Enterprise unlimited), with a max of 50 subscriptions per connection. Channel access is also tier-gated: a key below a channel’s tier (Market data = Layer 1, Wallet activity = Layer 2, Security & Coordination v2 = Layer 3) receives a non-fatal op:error when it tries to subscribe, while other channels in the same batch still succeed.

Message Format

All messages are JSON. Discriminated by the op field for control messages, or channel + data for events.

Client -> Server

Subscribe

{"op": "subscribe", "channels": ["token:<mint>:trades"]}

Unsubscribe

{"op": "unsubscribe", "channels": ["token:<mint>:trades"]}

Ping

{"op": "ping"}

Server -> Client

Subscription confirmed

{"op": "subscribed", "channels": ["token:<mint>:trades"]}

Unsubscription confirmed

{"op": "unsubscribed", "channels": ["token:<mint>:trades"]}

Pong

{"op": "pong"}

Error

{"op": "error", "message": "Subscription limit reached (max 50)"}

Data event

{"channel": "token:<mint>:trades", "data": { ... }}

Channel Naming

Market data

PatternDescription
token:<mint>:tradesLive trade tape
token:<mint>:ticksChart tick events
token:<mint>:ohlcv:<view>:<tf>OHLCV updates

Wallet activity

PatternDescription
wallet:<address>:pnlRealized PnL events
wallet:<address>:positionsPosition open/update/close
wallet:<address>:labelsLabel and badge state changes

Security

PatternDescription
token:<mint>:securityToken security events (bundle detected, wash trade, rug, coordination alert)
wallet:<address>:securityWallet-scoped security events

Coordination v2

PatternDescription
wallet:<address>:followFollow-edge activations and updates
wallet:<address>:entityEntity-membership changes
token:<mint>:campaignCoordinated campaign activations

Coming soon

PatternDescription
wallet:<address>:unrealized-pnlUnrealized PnL updates — not yet live

View values: full, filtered

Timeframe values: 1s, 1m, 5m, 15m, 1h

Connection Behavior

  • Server sends WebSocket ping every 30s
  • Slow consumers may drop messages
  • Subscriptions are lazily created and garbage collected
  • Invalid channel names return an error message, not a disconnect
  • Key validation: max 64 chars, alphanumeric and colons only