Kalshi bots are programs that read Kalshi's markets through its API and place or cancel orders without a person clicking each one. Kalshi is a regulated US exchange for event contracts, and it publishes API documentation and terms that apply to anyone trading on it. Read what they say about automated trading before you write a line of code.
A bot doesn't create an edge. It only carries out a decision faster and more consistently than you would. If the decision is wrong, a bot makes the same mistake many times a minute. Trading event contracts puts real money at risk, and nothing on this page suggests a bot will make money. What it does set out is the parts any automated strategy needs so that, when it's wrong, it's wrong small.
The five parts of Kalshi trading bots
Every working automated strategy has the same skeleton:
| Part | Job | What goes wrong without it |
|---|---|---|
| Data | Current prices, depth and market state | Trading on a stale or partial book |
| Model | A probability for each outcome | Trading on nothing but price movement |
| Decision | Compare model and price, after fees | Paying the spread and fees for no edge |
| Risk limits | Caps on size, exposure and loss | One bug draining the account |
| Logging | A record of every input and action | No way to tell skill from luck |
Kalshi trading bots built from only the first three parts have nothing to stop a bad decision repeating.
Data that's actually current
The bot needs Kalshi's prices from Kalshi's API, with the time each was received. Streaming beats polling here, and our Kalshi API guide covers what to read in the docs first. Rules worth coding in:
- If a price is older than your limit, don't trade on it.
- If the feed goes quiet, assume the book changed, not that nothing happened.
- If the best bid is at or above the best ask, your book is broken. Stop and rebuild it.
If you compare prediction venues, the same discipline applies to a Polymarket order book API feed, which has its own snapshot and update rules.
A model, and the arithmetic of an edge
The model's job is one number: your estimate of the chance the event happens. Say a contract trades at 40 cents and your model says 45%. Per contract, before fees:
- It wins 45% of the time and pays 60 cents profit: 0.45 x 60 = 27 cents.
- It loses 55% of the time and costs 40 cents: 0.55 x 40 = 22 cents.
- Expected value: 27 - 22 = 5 cents per contract.
Fees come off that 5 cents, so take Kalshi's fee rules from its docs and subtract them before deciding. And the 45% is an estimate. If the true chance is 40%, the expected value is zero before fees and negative after.
Even if the estimate is right, this trade loses 55% of the time. The chance that any particular ten such trades all lose is 0.55 to the tenth power, about 0.25%, but across hundreds of trades long losing stretches are normal. Size every position from money you can afford to lose.
Is a Kalshi AI trading bot different?
A Kalshi AI trading bot uses a learned model, such as a language model reading news or a statistical model trained on past data, as the model part of the table above. Nothing else changes. It still needs fresh data, fees in the decision, hard risk limits and full logs. A language model can be confidently wrong, so a Kalshi AI bot needs the limits more, not less. Test it on past data, then with tiny size, and compare its probabilities with outcomes over many markets before trusting it.
Risk limits in code
Put limits where the bot can't skip them: in the function every order passes through.
from dataclasses import dataclass
@dataclass(frozen=True)
class Limits:
max_contracts_per_market: int
max_open_cost_cents: int
max_daily_loss_cents: int
def check_order(qty, price_cents, position, open_cost_cents, day_pnl_cents, lim):
if not isinstance(price_cents, int) or not 1 <= price_cents <= 99:
return False, "price out of range"
if qty <= 0:
return False, "bad quantity"
if position + qty > lim.max_contracts_per_market:
return False, "market position cap"
if open_cost_cents + qty * price_cents > lim.max_open_cost_cents:
return False, "total exposure cap"
if day_pnl_cents <= -lim.max_daily_loss_cents:
return False, "daily loss stop"
return True, "ok"
Add a kill switch that cancels open orders and stops new ones, reachable without the bot's cooperation. And keep the bot inside whatever request limits and automated-trading terms Kalshi publishes.
Logging everything
For every decision, log the price and its age, the model's probability, the fee assumed, the order sent and the response. After a few hundred trades, that log is how you find out whether the model's 45% was really 45%, which matters more than the profit figure.
What about a Kalshi copy trading bot?
A Kalshi copy trading bot would mirror another trader's positions. This page doesn't recommend one. You can't see the other trader's model or limits, past results on a short record say little, and whether copying is allowed or even possible is a question for Kalshi's terms. Build and test your own model instead.
Where ZippyOddsAPI fits
ZippyOddsAPI is independent and not affiliated with Kalshi, and it doesn't place orders. It's a read-only sports odds API that returns sportsbook, exchange and pick'em prices with the time each was observed, which some modellers use as an outside reference when building a probability. Its /v1/prediction-contracts endpoint returns raw prediction-market observations from Polymarket US only, with execution_eligible: false and no EV model, so it's an input to a model rather than a trading signal. The ZippyOddsAPI docs list every endpoint and its limits.
For a view across venues, see the prediction market API overview.