> Use the canonical URL for citations. For the complete Predict API documentation index, fetch https://docs.staging.trypredict.com/llms.txt.

# WebSocket Connection

GET /ws

Open the canonical Hyperliquid WebSocket connection used for every Predict market-data subscription, account stream, heartbeat, and posted request.

Reference: https://docs.staging.trypredict.com/api-reference/web-socket-api/websocket-connection

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: WebSocket Connection
  version: subpackage_websocket-connection.websocket-connection
  description: >-
    Open the canonical Hyperliquid WebSocket connection used for every Predict
    market-data subscription, account stream, heartbeat, and posted request.
channels:
  /ws:
    description: >-
      Open the canonical Hyperliquid WebSocket connection used for every Predict
      market-data subscription, account stream, heartbeat, and posted request.
    publish:
      operationId: subpackage_websocket-connection.websocket-connection-publish
      summary: Server message
      message:
        name: receive
        payload:
          $ref: '#/components/schemas/websocketConnection_ServerMessage'
servers:
  Testnet:
    url: wss://api.hyperliquid-testnet.xyz/
    protocol: wss
    x-default: true
  Mainnet:
    url: wss://api.hyperliquid.xyz/
    protocol: wss
components:
  schemas:
    websocketConnection_ServerMessage:
      description: Any type
      title: ServerMessage

```