Kalshi AI
Trading Bot
An open-source toolkit for Kalshi prediction markets. A signed API client, a risk governor, and an edge harness that measures whether you actually beat the book — instead of claiming it. Free and MIT-licensed.
Built for serious traders, accessible to everyone
A signed API client, a risk governor, and an edge harness — packaged as an open-source bot you can run on your laptop.
One Model, Swappable
One model is called per decision — point primary_model at any OpenRouter slug and it swaps in. No hidden ensemble and no inflated claims: what you configure is what runs.
Paper Trading Mode
Every signal is logged against live market data and scored against Kalshi's real settlements — no simulated fills, just an honest P&L from markets that actually resolved. Graduate to live trading only on evidence.
Fractional-Kelly Sizing
Position size derived from each trade's expected value and your confidence, at a quarter-Kelly fraction. It caps size on uncertain signals — a guardrail against over-betting, not a promise of returns.
Live Universe Scan
Scans the active Kalshi universe — six figures of markets via the events API — and prices candidates off the live orderbook, not the stale snapshot. It surfaces candidates to investigate, not a buy list.
Safe Compounder Mode
A no-LLM, edge-based NO-side strategy. Smaller positions and maker orders, gated by a fee-aware edge floor. Not a promise of a higher win rate — just a cheaper, more disciplined scan.
Fully Open Source
Every line of code is public. Fork it, modify the prompts, swap models, add your own signals. MIT-licensed and built to be forked.
Measure first. Trade second.
Most bots assert an edge. This toolkit refuses to — it makes you prove one on settled reality, out-of-sample, before capital moves.
Clone & connect
Clone the repo, run the setup script, drop your Kalshi API key and private-key .pem in the project root, and confirm it with the health check. If it authenticates, you have cleared the hardest part.
python cli.py healthPaper trade first
Run the strategies against live markets with no money moving. You are not testing the code here — you are building the sample you will need to measure edge.
python cli.py run --paperProve — or disprove — your edge
The edge harness reconciles your settled trades against Kalshi's authoritative settlements and scores you on Brier, log-loss, and edge vs the book. It refuses to claim edge below 10 forward-settled trades.
python cli.py edgeGo live, small, on evidence
Only after a positive forward verdict. The risk governor enforces a daily-loss kill switch, a drawdown breaker, and a hard position cap — and it gates every order.
python cli.py run --safe-compounder --liveBuild it with other operators
The code is the easy part. The community is where you learn which markets are sharp and which edge is a mirage.
Discussions
Operators trading the same markets, sharing what actually moved the needle — and what blew up.
Open Discussions →Issues
Hit the private-key wall, an API field change, or a bug? File it with the repro and it gets looked at.
File an issue →Contribute
MIT-licensed and fork-friendly. Replace the example strategies with your own and send a PR.
Fork the repo →Run it without lighting your money on fire
The free Operator's Playbook covers getting connected, reading the silence, and staying online. The full Build & Run an AI Kalshi Bot guide covers controlling AI spend, surviving Kalshi API drift, reading the dashboard like an operator, and the paper-first protocol.
See what's in the guideNot out yet? Watch the repo and you'll see it first.
The honest reference set
Everything you need before you risk a dollar — written by the same people who measured their own edge at zero and published it.
Operator's Playbook
The setup traps: the private-key 401 wall, “it runs but never trades”, staying online.
Kalshi API field map
The *_dollars / *_fp names — and why a snapshot price will invent edges for you.
Fee calculator
What a fill costs, and the breakeven win rate before you size anything.
Edge calculator
Your probability minus the price, after fees — plus a quarter-Kelly stake.