Skip to content

Protocol Overview

The RTC Agent protocol consists of three layers, each with its own role: HTTP API handles authentication, WebSocket RPC handles all business operations, and real-time events drive frontend-backend state synchronization.

LayerProtocolPurposeFeatures
🔐 Auth LayerHTTPSOAuth2 authorization code flowStandard HTTP, compatible with all OAuth2 Providers
💬 Operation LayerWebSocket RPCSession, Message, Turn, RTC operations16 methods, divided into Action and Query types
📢 Event LayerWebSocket Pub/SubReal-time state pushDual-channel (Topic + Live), supports offline recovery

Handles user login and token management, following the standard OAuth2 authorization code flow.

3 endpoints cover the complete authentication lifecycle:

EndpointMethodFunction
/oauth2/authorizeGETGet OAuth2 authorization redirect URL
/oauth2/tokenPOSTExchange authorization code for access_token
/oauth2/refreshPOSTRefresh access_token

👉 Detailed docs: HTTP API

All business operations are performed over WebSocket RPC — sending messages, querying sessions, submitting tool results — all on a single persistent connection.

4 business domains, 16 methods:

DomainActionQuery
Sessionclose · update · fork · compactlist · get
Messagesendlist · get
Turnstoplist · get
RTCupdate_status · submit_resultlist · get

👉 Detailed docs: WebSocket RPC

The server pushes real-time events through a dual-channel architecture, balancing reliability and low latency.

ChannelPurposeFeatures
TopicState change eventsPersisted, Offset tracking, Offline recovery
LiveStreaming message intermediate chunksNon-persisted, low latency, fire-and-forget

👉 Detailed docs: Real-Time Events