Kalshi Setup Guide
Time: 10 minutes | Difficulty: Moderate | Market: Prediction Markets Mode: Full automation | API: REST API + WebSocket | Docs: docs.kalshi.com
This guide wires a Kalshi prediction market bot to the trading API using the botwir3 runtime. Configure API credentials, connect to CFTC-regulated event contracts, and run automated prediction market strategies locally.
Before you start
Verify that automated operation is permitted under Kalshi's current terms of service before deploying. Kalshi is a CFTC-regulated Designated Contract Market. botwir3 provides tools for building structured automation. The user is responsible for compliance with the platform's terms and all applicable regulations.
ℹ Regulatory landscape. Kalshi faces active legal challenges from several US states regarding sports and entertainment contracts. The platform has dismissed these as meritless. The user is responsible for verifying that Kalshi's offerings are available in the applicable state.
Kalshi Terms of Service | Last verified: May 2026
What you need
- A Kalshi account with identity verification and a funded balance
- API access enabled on the account
- The botwir3 runtime downloaded and unzipped
- A strategy config file from the builder
Step 1: Create API credentials
- Log in to kalshi.com
- Navigate to Settings → API
- Generate an API key and secret
- Copy both values
Permissions required: API access is granted at the account level. All trading permissions are inherited from the account. Permissions to disable: N/A. Withdrawal is not available through the API.
🔒 Security. Kalshi API keys do not grant withdrawal access. Fund transfers require the Kalshi website.
Step 2: Configure the adapter
Create adapter.json in the bot directory:
{
"adapter": "kalshi",
"credentials": {
"api_key": "paste-api-key-here",
"api_secret": "paste-api-secret-here"
},
"market_ticker": "FED-RATE-26JUN",
"environment": "live",
"rate_limit_ms": 500
}
market_ticker: Each event contract has a unique ticker. Find tickers at kalshi.com or via the API's market listing endpoint. Tickers follow a structured format (e.g., FED-RATE-26JUN, INXD-26MAY-B10000).
API keys are stored in a local config file on the machine running the bot. They are not transmitted to botwir3 or any third party. botwir3 never sees, stores, or has access to platform credentials.
Step 3: Test the connection
botwir3 test --adapter kalshi
Expected output:
[botwir3] Adapter: kalshi
[botwir3] Connection: OK
[botwir3] Permissions: trading
[botwir3] Rate limit: per API documentation
Step 4: Start the bot
botwir3 start --config my-strategy.json
The runtime loads the strategy, computes the spec hash, connects to Kalshi via the local API credentials, and begins evaluating signals. The gate function compares proposed actions against the configured spec. The user is responsible for monitoring the bot and verifying execution outcomes.
Rate limits and considerations
| Endpoint | Limit | Notes |
|---|---|---|
| REST API | Rate-limited per documentation | See Kalshi API docs for current limits |
| WebSocket | Per connection | Real-time order book and settlement data |
| Order placement | Included in REST limit | Create, cancel, amend |
ℹ Event contract structure. Kalshi contracts are binary (Yes/No) with prices between $0.01 and $0.99. Contracts settle at $1.00 (Yes) or $0.00 (No) based on the event outcome. Categories include economics (Fed rates, CPI), weather, politics, and more.
Common Kalshi bot configurations include probability calibration strategies (comparing model-derived probabilities against market prices), event-driven trading around scheduled announcements (Fed meetings, economic data releases), and market-making across multiple correlated contracts. All actions and decisions are recorded in the local ledger.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
CONNECTION_REFUSED | API key invalid or account not API-enabled | Verify API key and ensure API access is enabled in Settings |
RATE_LIMITED | Request limit exceeded | Increase rate_limit_ms in adapter config |
MARKET_NOT_FOUND | Invalid market_ticker or market has settled | Verify ticker at kalshi.com or via the API market listing endpoint |
INSUFFICIENT_FUNDS | Account balance too low for proposed trade | Fund the account via the Kalshi website |
MANDATE_INTEGRITY_VIOLATION | Config file modified while bot is running | Stop the bot, verify config, restart |
Related guides
- Polymarket Setup Guide — prediction markets, CLOB API, on-chain
- Manifold Markets Setup Guide — prediction markets, play-money (Mana)
- PredictIt Signal Monitor Setup Guide — prediction markets, signal-only
One bot. $129. No subscription. No $749/mo platform. → Build for Kalshi