{
  "product": "Hyperlight API",
  "api_base_url": "https://api.hyperlightapi.xyz",
  "openapi_spec": "https://hyperlightapi.xyz/openapi.yaml",
  "last_updated": "2026-03-14",
  "authentication": {
    "api_key": {
      "header": "X-Api-Key",
      "prefix": "hlt_",
      "example": "X-Api-Key: hlt_your_key_here"
    },
    "bearer": {
      "header": "Authorization",
      "format": "Bearer <api_key_or_jwt>"
    },
    "query": {
      "parameter": "api_key",
      "example": "?api_key=hlt_your_key_here"
    }
  },
  "categories": [
    {
      "name": "Health & Status",
      "endpoints": [
        {
          "method": "GET",
          "path": "/health",
          "auth": false,
          "summary": "Health check with dependency status"
        },
        {
          "method": "GET",
          "path": "/status",
          "auth": false,
          "summary": "Lighter network status"
        }
      ]
    },
    {
      "name": "Authentication",
      "endpoints": [
        {
          "method": "POST",
          "path": "/api/v1/auth/register",
          "auth": false,
          "summary": "Register account and get API key + JWT"
        },
        {
          "method": "POST",
          "path": "/api/v1/auth/login",
          "auth": false,
          "summary": "Login and get JWT token"
        }
      ]
    },
    {
      "name": "API Key Management",
      "endpoints": [
        {
          "method": "POST",
          "path": "/api/v1/keys",
          "auth": true,
          "summary": "Create new API key"
        },
        {
          "method": "GET",
          "path": "/api/v1/keys",
          "auth": true,
          "summary": "List API keys (prefix only)"
        },
        {
          "method": "PATCH",
          "path": "/api/v1/keys/:key_id",
          "auth": true,
          "summary": "Update key (name, IPs, tier)"
        },
        {
          "method": "DELETE",
          "path": "/api/v1/keys/:key_id",
          "auth": true,
          "summary": "Soft-delete key"
        },
        {
          "method": "GET",
          "path": "/api/v1/keys/:key_id/usage",
          "auth": true,
          "summary": "Hourly usage breakdown"
        }
      ]
    },
    {
      "name": "Batch Account Queries",
      "endpoints": [
        {
          "method": "POST",
          "path": "/api/v1/accounts/batch",
          "auth": true,
          "summary": "Batch query up to 1,000 accounts (positions, orders, fills)",
          "credits": 25
        },
        {
          "method": "POST",
          "path": "/api/v1/accounts/batch/fills",
          "auth": true,
          "summary": "Batch fills across accounts",
          "credits": 25
        },
        {
          "method": "POST",
          "path": "/api/v1/accounts/batch/positions",
          "auth": true,
          "summary": "Batch positions across accounts",
          "credits": 25
        },
        {
          "method": "POST",
          "path": "/api/v1/accounts/batch/liquidations",
          "auth": true,
          "summary": "Batch liquidation events",
          "credits": 25
        },
        {
          "method": "GET",
          "path": "/api/v1/accounts/:account_id/positions",
          "auth": true,
          "summary": "Single account open positions"
        },
        {
          "method": "GET",
          "path": "/api/v1/accounts/:account_id/fills",
          "auth": true,
          "summary": "Single account fill history"
        },
        {
          "method": "GET",
          "path": "/api/v1/accounts/:account_id/pnl",
          "auth": true,
          "summary": "PnL snapshot history"
        },
        {
          "method": "GET",
          "path": "/api/v1/accounts/:account_id/liquidation-risk",
          "auth": true,
          "summary": "Account liquidation risk heatmap"
        }
      ]
    },
    {
      "name": "Orderbook",
      "endpoints": [
        {
          "method": "GET",
          "path": "/api/v1/orderbook/:market_id",
          "auth": true,
          "summary": "Current orderbook (Redis-cached, sub-second)"
        },
        {
          "method": "GET",
          "path": "/api/v1/orderbook/:market_id/depth",
          "auth": true,
          "summary": "Aggregated depth at configurable price levels"
        },
        {
          "method": "GET",
          "path": "/api/v1/orderbook/:market_id/snapshots",
          "auth": true,
          "summary": "Historical orderbook at any point in time"
        }
      ]
    },
    {
      "name": "Trades",
      "endpoints": [
        {
          "method": "GET",
          "path": "/api/v1/trades/by-time",
          "auth": true,
          "summary": "Trades within arbitrary time ranges"
        },
        {
          "method": "GET",
          "path": "/api/v1/trades/aggregate",
          "auth": true,
          "summary": "VWAP + volume aggregation at custom intervals"
        }
      ]
    },
    {
      "name": "Liquidations",
      "endpoints": [
        {
          "method": "GET",
          "path": "/api/v1/liquidations/by-time",
          "auth": true,
          "summary": "Liquidation events within a time range"
        },
        {
          "method": "GET",
          "path": "/api/v1/liquidations/recent",
          "auth": true,
          "summary": "Recent liquidations across all markets"
        },
        {
          "method": "GET",
          "path": "/api/v1/liquidation-heatmap/:market_id",
          "auth": true,
          "summary": "Position liquidation heatmap"
        },
        {
          "method": "GET",
          "path": "/api/v1/liquidation-heatmap/:market_id/cascade",
          "auth": true,
          "summary": "Cascade effect analysis"
        }
      ]
    },
    {
      "name": "Candles & Funding",
      "endpoints": [
        {
          "method": "GET",
          "path": "/api/v1/candles",
          "auth": true,
          "summary": "OHLCV candles at multiple resolutions"
        },
        {
          "method": "GET",
          "path": "/api/v1/funding-rates",
          "auth": true,
          "summary": "Current funding rates"
        },
        {
          "method": "GET",
          "path": "/api/v1/funding-rates/history",
          "auth": true,
          "summary": "Historical funding rate data"
        }
      ]
    },
    {
      "name": "Exchange Analytics",
      "endpoints": [
        {
          "method": "GET",
          "path": "/api/v1/exchange/stats",
          "auth": true,
          "summary": "24h volume, open interest, price changes per market"
        },
        {
          "method": "GET",
          "path": "/api/v1/exchange/metrics",
          "auth": true,
          "summary": "Historical exchange-level metrics"
        }
      ]
    },
    {
      "name": "Leaderboard",
      "endpoints": [
        {
          "method": "GET",
          "path": "/api/v1/markets/:market_id/top-accounts",
          "auth": true,
          "summary": "Top accounts in a market by position size (tier-limited)"
        },
        {
          "method": "GET",
          "path": "/api/v1/exchange/top-accounts",
          "auth": true,
          "summary": "Top accounts exchange-wide by total position notional (tier-limited)"
        }
      ]
    },
    {
      "name": "Data Lake",
      "endpoints": [
        {
          "method": "GET",
          "path": "/api/v1/data-lake/exports",
          "auth": true,
          "summary": "List available Parquet exports"
        },
        {
          "method": "GET",
          "path": "/api/v1/data-lake/download/:export_id",
          "auth": true,
          "summary": "Pre-signed S3 download URL"
        }
      ]
    },
    {
      "name": "Market Alerts",
      "endpoints": [
        {
          "method": "POST",
          "path": "/api/v1/signals",
          "auth": true,
          "summary": "Create alert rule (JSON DSL)"
        },
        {
          "method": "GET",
          "path": "/api/v1/signals",
          "auth": true,
          "summary": "List user alerts"
        },
        {
          "method": "GET",
          "path": "/api/v1/signals/:signal_id",
          "auth": true,
          "summary": "Get alert details"
        },
        {
          "method": "PATCH",
          "path": "/api/v1/signals/:signal_id",
          "auth": true,
          "summary": "Update alert rule"
        },
        {
          "method": "DELETE",
          "path": "/api/v1/signals/:signal_id",
          "auth": true,
          "summary": "Delete alert"
        },
        {
          "method": "GET",
          "path": "/api/v1/signals/:signal_id/backtest",
          "auth": true,
          "summary": "Backtest alert against historical data"
        }
      ]
    },
    {
      "name": "Billing",
      "endpoints": [
        {
          "method": "POST",
          "path": "/api/v1/billing/checkout",
          "auth": true,
          "summary": "Create Stripe checkout session"
        },
        {
          "method": "POST",
          "path": "/api/v1/billing/portal",
          "auth": true,
          "summary": "Create Stripe customer portal"
        }
      ]
    }
  ],
  "websocket": {
    "url": "wss://api.hyperlightapi.xyz/stream",
    "auth_message": "{\"type\": \"auth\", \"api_key\": \"hlt_...\"}",
    "channels": [
      {
        "name": "order_book/{market_id}",
        "description": "Live orderbook updates (direct upstream proxy)"
      },
      {
        "name": "enriched_order_book/{market_id}",
        "description": "Orderbook with account attribution and whale flags"
      },
      {
        "name": "enriched_trade/{market_id}",
        "description": "Trades with account attribution"
      },
      {
        "name": "trade/{market_id}",
        "description": "Raw trade updates"
      },
      {
        "name": "alert/{market_id}",
        "description": "Large order and whale activity alerts"
      },
      {
        "name": "liquidation_heatmap/{market_id}",
        "description": "Real-time liquidation heatmap updates"
      }
    ],
    "replay": {
      "url": "wss://api.hyperlightapi.xyz/stream/replay",
      "description": "Historical data replay at 0.1x-100x speed with pause/resume controls"
    }
  },
  "total_rest_endpoints": 43,
  "total_ws_channels": 6
}