Guide
Prediction marketMarket dataEvent contracts API key

Kalshi API guide

Kalshi lists yes/no contracts on economic releases, weather, politics and more, and it is regulated by the CFTC, which makes it the main prediction-market API for US developers.

Last verified

Quick answer

Kalshi is a CFTC-regulated US exchange for event contracts with REST, WebSocket and FIX APIs. Authenticated requests carry KALSHI-ACCESS-KEY, KALSHI-ACCESS-TIMESTAMP (ms) and KALSHI-ACCESS-SIGNATURE, an RSA-PSS (SHA-256) signature of timestamp + method + path made with the private key you download at key creation. Rate limits are token budgets (most endpoints cost 10 tokens).

Kalshi API at a glance

Pricing
API free; per-contract trading fees
Availability
US (CFTC-regulated) and select countries
Paper trading
Demo environment
Integration type
Asymmetric / wallet signing
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
REST base
https://api.elections.kalshi.com/trade-api/v2
Demo
https://demo-api.kalshi.co/trade-api/v2
Auth
RSA-PSS signature headers with key id + timestamp
Limits
Token budgets; most endpoints cost 10 tokens
Prices
Cents (1–99) per contract

Markets, events and series

A series (e.g. monthly CPI) contains events, each with one or more markets (yes/no contracts). GET /markets, /markets/{ticker}/orderbook and /series/{series}/markets/{ticker}/candlesticks provide data; many market-data endpoints are public.

RSA-PSS signing

Concatenate the millisecond timestamp, the HTTP method and the request path (without query), sign it with RSA-PSS using SHA-256 and your private key, and base64 the result. Python’s standard library has no RSA, so use cryptography or the official SDK.

Build a Kalshi strategy with AlgoGP

AlgoGP does not connect to Kalshi natively yet. Kalshi requires asymmetric or wallet signatures (JWT, RSA-PSS or EIP-712) that the standard-library Python AlgoGP exports cannot produce without an extra library.

  1. 1

    Design and backtest in AlgoGP

    Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.

  2. 2

    Export the Python project

    Every project exports strategy.py, market_data.py, brokers.py and live.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format.

  3. 3

    Plug in Kalshi

    Implement the four adapter methods (account, positions, submit_market_order and a candle fetcher) with Kalshi’s SDK, or keep a built-in platform for paper trading and add Kalshi when you go live.

Kalshi API: frequently asked questions

Is Kalshi legal in the US?

Yes. Kalshi is a CFTC-designated contract market; some states have contested specific contract types.

Does Kalshi have a demo API?

Yes, a separate demo environment with its own accounts and keys.

Is the Kalshi API free?

There is no API fee; trading fees apply per contract.

Design and backtest your Kalshi strategy first

AlgoGP turns an idea into Python and tests it on years of history before you connect it to Kalshi. The exported code keeps the broker behind four small adapter methods.

  • AI copilot writes and revises the rules
  • Backtests with realistic costs
  • Exported Python ready to wire to Kalshi

Free plan, no card required.

Kalshi alternatives

Independent guide. AlgoGP is not affiliated with Kalshi. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.