Connect
Production endpoint:Message protocol
Every message — client or server — is a JSON object with atype field.
| Field | Direction | Purpose |
|---|---|---|
type | both | Identifies the kind of message. |
request_id | client -> server | Optional. Echoed back by the server so you can correlate responses. |
data | both | Payload. Shape depends on type. |
Client messages
subscribe - join one or more channels
subscribe - join one or more channels
Subscribe to any combination of channels. You can subscribe more than once; new channels are added to the existing set.Available channels:
| Channel | Broadcasts |
|---|---|
trades | Order fills and cancellations on your traders |
positions | Opened, updated, and closed positions |
model_chat | AI trader decisions and reasoning |
asset_curve | Equity and daily PnL updates (every ~60s) |
bootstrap - fetch initial state
bootstrap - fetch initial state
Ask the server for the current accounts, positions, and active orders so you can render a UI without a separate HTTP round trip.The server replies with a single
bootstrap message containing the full snapshot, then continues streaming updates on the channels you subscribed to.switch_account - change the context
switch_account - change the context
Point the connection at a different AI trader. Subsequent broadcast events will apply to this account.
get_snapshot - point-in-time state
get_snapshot - point-in-time state
Request a one-off snapshot of an account’s equity and positions without subscribing.
get_asset_curve - historical equity series
get_asset_curve - historical equity series
Fetch the asset curve for charting.Valid timeframes:
1d, 7d, 30d, 90d, all.place_order - execute a trade
place_order - execute a trade
You can place orders over the WebSocket to avoid a round-trip to the REST API. The response is pushed as a See
trade_update event on the trades channel.POST /api/orders/create in the Orders reference for the full request schema.ping - keep-alive
ping - keep-alive
Send
{ "type": "ping" } periodically to keep the connection open through any proxy. The server replies with { "type": "pong" }.Server events
The server pushes messages of these types to subscribed clients:trade_update
Fired when an order changes state — accepted, filled, partially filled, cancelled, rejected.
position_update
Fired when a position opens, updates, or closes.
model_chat_update
Fired when an AI trader produces or updates a decision, including streamed reasoning chunks.
asset_curve_update
Fired roughly every minute with updated equity and PnL figures.
error
Sent when a client message fails to parse or the server cannot fulfil the request.
Connection lifecycle
Open the socket with your token
Use
wss://api.production.hyperoru.com/ws?session_token=.... The server closes the connection immediately if the token is missing or invalid.Handle reconnects
Networks drop. On unexpected close, wait 1-5 seconds with jitter, reconnect, and resubscribe. The server will deliver fresh state on reconnect — there is no replay buffer.
Related
REST introduction
Browse every HTTP endpoint with interactive examples.
Market intelligence stream
Server-sent events for market commentary and regime updates.