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

# Connection Keep-Alive

GET /ws

Keep a Predict trading WebSocket connected by sending a Hyperliquid ping before 60 seconds of outbound inactivity and handling each pong response.

Reference: https://docs.staging.trypredict.com/api-reference/web-socket-api/keep-alive

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: Connection Keep-Alive
  version: subpackage_keep-alive.keep-alive
  description: >-
    Keep a Predict trading WebSocket connected by sending a Hyperliquid ping
    before 60 seconds of outbound inactivity and handling each pong response.
channels:
  /ws:
    description: >-
      Keep a Predict trading WebSocket connected by sending a Hyperliquid ping
      before 60 seconds of outbound inactivity and handling each pong response.
    publish:
      operationId: subpackage_keep-alive.keep-alive-publish
      summary: Server message
      message:
        name: pong
        payload:
          $ref: '#/components/schemas/keepAlive_Pong'
    subscribe:
      operationId: subpackage_keep-alive.keep-alive-subscribe
      summary: Client message
      message:
        name: ping
        payload:
          $ref: '#/components/schemas/keepAlive_Ping'
servers:
  Testnet:
    url: wss://api.hyperliquid-testnet.xyz/
    protocol: wss
    x-default: true
  Mainnet:
    url: wss://api.hyperliquid.xyz/
    protocol: wss
components:
  schemas:
    keepAlive_Pong:
      type: object
      properties:
        channel:
          type: string
          enum:
            - pong
      required:
        - channel
      title: Pong
    keepAlive_Ping:
      type: object
      properties:
        method:
          type: string
          enum:
            - ping
      required:
        - method
      title: Ping

```