Prediction Markets

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

  1. Log in to kalshi.com
  2. Navigate to Settings → API
  3. Generate an API key and secret
  4. 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

EndpointLimitNotes
REST APIRate-limited per documentationSee Kalshi API docs for current limits
WebSocketPer connectionReal-time order book and settlement data
Order placementIncluded in REST limitCreate, 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

ErrorCauseFix
CONNECTION_REFUSEDAPI key invalid or account not API-enabledVerify API key and ensure API access is enabled in Settings
RATE_LIMITEDRequest limit exceededIncrease rate_limit_ms in adapter config
MARKET_NOT_FOUNDInvalid market_ticker or market has settledVerify ticker at kalshi.com or via the API market listing endpoint
INSUFFICIENT_FUNDSAccount balance too low for proposed tradeFund the account via the Kalshi website
MANDATE_INTEGRITY_VIOLATIONConfig file modified while bot is runningStop the bot, verify config, restart

Related guides


One bot. $129. No subscription. No $749/mo platform. → Build for Kalshi


Build your Kalshi bot

Ready to build?