Install Python
The bot is written in Python. If you already ran it before, skip to step 2.
- Go to python.org/downloads and click the yellow Download Python 3.x button.
- Open the installer. On the first screen, tick Add python.exe to PATH, then click Install Now.
- To check it worked, press Windows, type PowerShell, open it, and run:
python --version
You should see something like Python 3.13.1. You need 3.11 or newer.
Unzip the bot
- Download
kalshi_tennis_bot.zipfrom your Claude conversation. - In File Explorer, right-click the zip and choose Extract All…. Pick an easy place such as
Documents, then click Extract. - Open the new
kalshi_tennis_botfolder. You should seestart_website.bat,start_public_link.bat, abotfolder and more.
Upgrading from an older copy? Extract the new zip on top of the old folder and choose Replace. Your data folder, password and keys stay.
Open the website
- Double-click
start_website.bat. - If Windows shows "Windows protected your PC", click More info, then Run anyway. It shows this for any downloaded script.
- A black window opens and installs three small libraries the first time. Then your browser opens
http://127.0.0.1:8765.
127.0.0.1:8765 into the address bar.Create your password
The first time, the website asks you to create a password. Use 8 or more characters, and don't reuse your Kalshi or email password.
- You'll type it whenever you open the dashboard on a new device, such as your phone.
- For safety, the first password can only be created on the computer that runs the bot.
- You can change it later under Settings → Change website password. That also signs out every other device.
Forgot it? See Troubleshooting.
First scan in Paper mode
- On the Dashboard, leave the mode on Paper.
- Tick Watch only (don't place trades) for this first look.
- Click Start. The first start takes about a minute while the bot downloads around 65,000 past match results to rate every player. Later starts take a few seconds.
- About every 20 seconds the bot scans every Kalshi tennis match market: ATP, WTA, Challenger and ITF.
When you're happy it's working, click Stop, untick Watch only, and click Start again. Paper mode then records simulated bets with a pretend $1,000 bankroll, so you can see how the bot would have done.
Read the dashboard
Best prices right now lists every match the bot could price, best value first. Each Kalshi contract pays $1 if that player wins, so a price of 49¢ means the market gives them about a 49% chance.
| Match | Score / start | Pick | Our fair | Kalshi ask | Edge | Result | |
|---|---|---|---|---|---|---|---|
| ● Live | R. Karki vs J. Brumm | Sets 0-0 | 1-3 | 15-30 | J. Brumm | 82.0% | 72¢ | +8.8¢ | Bought |
| Pre-match | D. Siniakov vs M. Donald | in 2h 3m | D. Siniakov | 41.0% | 39¢ | −0.3¢ | Edge too small |
Example rows for illustration, not real picks.
| Our fair | The bot's estimate of the pick's chance to win, from live score, serve stats, bookmaker odds and the market. |
|---|---|
| Kalshi ask | The cheapest price you can buy at right now. |
| Edge | Fair value minus price minus Kalshi's fee, in cents per $1 contract. The bot only buys above your minimum: 5¢ pre-match and 7¢ in-play by default. |
| Result | Bought (or Would buy in watch-only mode), or the reason it passed. |
Skipped matches shows every match the bot refused and why. It never bets on a match that is postponed, suspended, interrupted, cancelled or delayed, or one whose live score feed is late.
Add a bookmaker odds key
This lets the bot compare Kalshi's prices with dozens of sportsbooks. That's the bot's main pre-match signal. Without it, the bot only bets on matches already in play.
- Go to the-odds-api.com, choose the free plan (500 requests a month), and enter your email. They email you a key.
- In the bot website, open API Keys, paste it under Bookmaker odds, and click Save.
- Stop and Start the bot so it picks up the key.
Sportsbooks only list main-tour ATP and WTA matches, not Challenger or ITF, so pre-match bets will be rare until the season restarts in late December.
Connect a Kalshi demo account
Demo mode sends real orders to Kalshi's practice exchange. It's the best test of the full system before real money. The demo site is separate from kalshi.com and needs its own sign-up.
- Go to demo.kalshi.co and create an account.
- Open your account settings and find API Keys. Kalshi sometimes moves menus, so look for "API". Click Create key.
- Kalshi shows a Key ID (a long code with dashes) and downloads a private key file, usually to
Downloads. This file is shown only once, so keep it. - In the bot website, open API Keys → Demo key. Paste the Key ID, click Choose File, and pick that private key file.
- Click Save key, then Test connection. You should see Connected and your demo balance.
- On the Dashboard, choose Demo and click Start.
keys folder.Demo markets copy the real ones but have fewer traders, so expect fewer fills than in Paper mode.
Get your permanent link for Chrome, Safari or your phone
The bot runs on your Windows computer. Tailscale Funnel (free) gives it a fixed https:// address that never changes. Bookmark it once, then paste or click it in any browser, on any phone or computer.
- Finish step 4 first. The link only switches on after your website password exists.
- Make sure the bot website is running (
start_website.bat, black window open). - Double-click
setup_permanent_link.bat. - The first time, it installs Tailscale with Windows' own installer,
winget. If Windows asks for permission or to accept terms, read them and choose Yes. - Your browser opens Tailscale's sign-in page. Create a free account with Google, Microsoft, Apple or GitHub.
- The black window may show a
login.tailscale.comlink asking you to enable Funnel. Open it and click the enable button. This is needed only once. The window then carries on by itself. - The window shows YOUR PERMANENT LINK, something like
https://my-pc.tail1a2b3.ts.net. The dashboard also shows it, with a Copy link button. - Send it to yourself (text or email). Open it in Chrome or Safari, log in with your bot password, and bookmark it.
Turn the permanent link off
Open PowerShell in the bot folder (step "flashes and closes" in Troubleshooting shows how) and run the command below. The dashboard keeps working on this PC at 127.0.0.1:8765.
python permanent_link.py --off
Alternative: a quick temporary link with no account
Double-click start_public_link.bat instead of start_website.bat. It installs Cloudflare's free tunnel tool (cloudflared) and shows a link like https://quiet-river-1234.trycloudflare.com on the dashboard. That link changes every time you restart, so it's only good for a quick test.
If the automatic install fails, download cloudflared-windows-amd64.exe from Cloudflare's official downloads page, rename it to cloudflared.exe, and put it in the bot folder.
Keep it running
The bot and your link work only while your computer is on, awake and online. Set it up once so it looks after itself:
- Start with Windows: double-click
autostart_on.bat. From now on the bot website starts by itself, minimized, whenever you sign in to Windows. - Resume after restarts: nothing to do. If Paper or Demo was running when the PC restarted, it carries on by itself. Live mode never restarts on its own; you press Start again yourself.
- Stop sleep: open Settings → System → Power & battery → Screen, sleep & hibernate timeouts. Set "When plugged in, put my device to sleep after" to Never. The screen may still turn off; that's fine.
- Keep a laptop plugged in.
To stop starting with Windows, double-click autostart_off.bat. Open bets are never lost during a restart; they settle when the matches finish.
Judge the results honestly
The Trades tab shows every bet for each mode: price, fair value, edge, won or lost, and profit or loss.
- Wait for 100+ settled bets before judging. Over 20 bets, luck swamps skill.
- Look at ROI (profit ÷ amount staked). It needs to stay clearly positive after fees in Paper and Demo.
- Check the in-play bets separately from pre-match ones. They use different models.
Live mode (real money)
Only do this if step 11 looks clearly good, and only with money you can afford to lose.
- On kalshi.com, finish identity verification and add funds yourself.
- Create an API key there, exactly as in step 8. Live keys and demo keys are different and don't work on the other site.
- In the bot website, open API Keys → Live key, save it, and click Test connection.
- Open Settings → Money limits (LIVE). Defaults: $5 per bet, $10 per match, $50 at risk overall, stop after losing $25 in a day, 15 bets a day.
- On the Dashboard, choose Live, click Start, and type
I UNDERSTAND THIS USES REAL MONEYto confirm.
A red banner stays on the dashboard while live trading is on. You're responsible for following Kalshi's rules for API trading. Read their terms before you start.
Stop the bot
- Normal stop: press Stop on the dashboard, from any device. It finishes the current scan, then stops.
- Shut everything down: close the black window.
- Emergency switch: create an empty file named
STOP(no extension) in the bot folder. The bot stops opening trades and exits. Delete the file to run again.
Stopping doesn't cancel bets already placed. They settle when the matches end.
"python is not recognized"
Python isn't on your PATH. Run the Python installer again, choose Modify (or reinstall), and tick Add python.exe to PATH. Then close and reopen any black windows.
The black window flashes and closes, or shows an error
Open the bot folder, click the address bar, type powershell, and press Enter. Then run the command below. The error stays on screen so you can read it or paste it to Claude.
python web_app.py
The page won't load at 127.0.0.1:8765
The black window must be open. If it says the address is already in use, another copy is running; close the extra black windows and try again.
The demo or live key says "not set"
The bot needs both the Key ID and the private key file. Choose the file Kalshi downloaded when you created the key. If you lost it, delete that key on Kalshi and create a new one.
"Test connection" fails
- A demo key only works in the Demo slot, and a live key only in the Live slot.
- Kalshi rejects requests if your PC clock is off by more than 30 seconds. Open Settings → Time & language → Date & time and click Sync now.
- Check you copied the whole Key ID.
The public link doesn't open on my phone
- The link changes every restart. Copy the current one from the dashboard on your computer.
- The computer must be awake with the black window open (step 10).
- Some work or school Wi-Fi networks block tunnels. Try mobile data.
I keep getting sent back to the login screen
Your browser is blocking cookies for the site, which is common in private or incognito windows. Use a normal window, or allow cookies for the bot link.
I forgot my password
- Close the black window.
- In the bot folder, open
dataand deleteauth.json. - Start the bot again on the computer itself. It asks you to create a new password. Every device is signed out.
"Too many wrong passwords"
After 5 wrong tries in 15 minutes, logins lock for 15 minutes. That protects the public link from guessing. Wait, then try again.
The bot isn't placing any bets
- Check Skipped matches for the reasons.
- If "Watch only" is on, the bot never places trades.
- Pre-match bets need the odds key (step 7) and main-tour matches.
- A yellow banner means a safety limit was hit, such as the daily loss limit. It resets the next day.
- A good edge is rare. Quiet days are normal.
How the bot picks
- Live score feed: Kalshi's own scoreboard data gives every point, game and set, who is serving, serve statistics, and whether the match is running, delayed, suspended or postponed.
- In-play model: an exact point-by-point tennis model works out each player's chance to win from the current score and server. It handles tiebreaks, 10-point match tiebreaks, and best-of-3 or best-of-5.
- Pre-match: sportsbook consensus odds (step 7) blended with Kalshi's price. Player ratings from about 65,000 Kalshi results are shown but switched off, because testing found they hurt.
- Execution: before every order the bot re-checks the price on the order book. It only buys at that price or better, and cancels anything that doesn't fill instantly.
- Bet size: a cautious fraction of the Kelly formula, capped per bet, per match, per day and in total.