Skip to main content
Kalshi is a CFTC-regulated prediction market exchange. Orders use traditional limit-order semantics with the server signing each request using your registered RSA private key — no client-side cryptography required.

At a glance

Prerequisites

  • A funded Kalshi account
  • A Kalshi API key pair — generate at kalshi.com/account/api by uploading the public half of an RSA keypair you generate locally
  • Your RSA private key in PEM format
If you don’t already have an RSA keypair, generate one:
Upload kalshi-key.pub to Kalshi. Note the API key ID it returns (a UUID).

One-time setup: register credentials

Run this once per user. The Delphi server stores the RSA key encrypted at rest and uses it to sign every Kalshi request you make through the proxy.

Place an order

Order parameters

Kalshi prices are in cents, not dollars or fractions. A 54¢ limit means price_cents: '54', not '0.54'.

Query and cancel

Common pitfalls

The server’s signature is being rejected by Kalshi. Usually one of:
  • The PEM you registered isn’t the private half of the keypair you uploaded to Kalshi
  • The PEM has Windows line endings (\r\n) — re-save the file with Unix line endings (\n)
  • The PEM is missing the -----BEGIN PRIVATE KEY----- / -----END PRIVATE KEY----- envelope
Re-register with a fresh PEM read via readFileSync('./kalshi-key.pem', 'utf-8').
Kalshi tickers can change format between events. Pull the latest market list from GET /api/v1/klsi/markets (or the Kalshi API directly) before placing orders to confirm the ticker is current.
Kalshi imposes per-market position limits (often $25,000 max exposure per market for retail accounts). Check your remaining headroom in the Kalshi UI before placing a large order.
Kalshi has separate api.elections.kalshi.com (production) and demo-api.kalshi.co (sandbox) endpoints. The Delphi server uses production by default. Sandbox API keys are not interchangeable. If you want sandbox access for testing, contact Delphi support.

API reference