Skip to main content
Kalshi is a CFTC-regulated US event-contract exchange. OpenPX talks to its REST API (api.elections.kalshi.com) and authenticated WebSocket.

Config

FieldTypeRequiredDescription
api_key_idstringfor authAPI key identifier
private_key_pemstringfor authRSA private key contents (PEM)
private_key_pathstringalt. to PEMFilesystem path to a .pem file
api_urlstringoptionalOverride the API base URL
demobooloptionalUse the demo environment
verbosebooloptionalVerbose logging
Public read-only methods (markets, orderbooks, trades) work without credentials. Orders, balances, and WebSocket require auth.

Environment variables

KALSHI_API_KEY_ID
KALSHI_PRIVATE_KEY_PEM      # or KALSHI_PRIVATE_KEY_PATH

Identifiers

  • Market.id is the Kalshi ticker (e.g. KXBTC-25MAR14-T20000).
  • WebSocket subscribe target is the same ticker.
  • Outcomes: "Yes" / "No".

Capabilities

MethodAvailable
fetch_markets / fetch_marketYes
fetch_orderbookYes
fetch_tradesYes
fetch_price_historyYes
create_order / cancel_order / fetch_open_ordersAuth
fetch_positions / fetch_balance / fetch_fillsAuth
WebSocketAuth
Inspect ex.describe() at runtime for the source of truth.

Rate limits

BucketLimit
Default20 req/sec, burst 5
Write (orders)10 req/sec, burst 3
Bulk10 req/sec, burst 3