Skip to main content
The proxy handles Kalshi WebSocket authentication (RSA-PSS) automatically using the credentials in .env. You connect to the proxy without needing to implement Kalshi’s auth protocol yourself.

Connect

wscat -c "wss://gateway.graylayer.tech/ws/kalshi?api_key=your_key"

Subscribe to channels

After connecting, send a subscribe command:
{"id": 1, "cmd": "subscribe", "params": {"channels": ["ticker"]}}
Available channels (see Kalshi WebSocket docs):
  • ticker — price and volume updates
  • orderbook_delta — orderbook changes
  • trade — trade events
  • fill — fill events (requires authentication)
{"id": 2, "cmd": "subscribe", "params": {"channels": ["orderbook_delta"], "market_tickers": ["KXBTC-24NOV"]}}

Troubleshooting

401 Unauthorized? Kalshi demo and production use different credentials. If your key is from demo.kalshi.co, set:
KALSHI_WS_URL=wss://demo-api.kalshi.co/trade-api/ws/v2
Upstream: wss://api.elections.kalshi.com/trade-api/ws/v2