Kalshi trading bot: API rules, demo and real-time X signals

Build a Kalshi bot in 2026: what Kalshi allows, Kalshi API keys, rate limits and demo, plus real-time X and Truth Social signals for post-driven markets.

$199/mo for 50 accounts after a 3-day, 5-account trial

Published August 3, 2026 · Updated November 11, 2026 · 15 min read · TweetStream team

Yes, you can run a Kalshi trading bot: Kalshi documents its API for real-time market data and trade execution, and its rulebook covers orders placed by automated functionality. Kalshi has no news or social feed, so a bot that trades on posts needs a second input. TweetStream streams posts from the X accounts you choose, plus supported Truth Social posts on Pro and above.

Does Kalshi allow bots?

Yes, Kalshi allows bots. Its developer docs describe the API as covering real-time market data and trade execution, and its rulebook treats orders sent by automated functionality like any other order. A bot also takes on the rules a person would follow. Using the API binds you to Kalshi's Developer Agreement, the rulebook requires controls against excessive messaging, and the member is responsible for every order the bot sends.

Scroll horizontally to compare →

What Kalshi's own pages say about automated trading
SourceWhat it saysWhat it means for your bot
Kalshi API docsThe API covers the Kalshi Exchange for real-time market data and trade execution. Using it binds you to Kalshi's Developer Agreement.API trading is a supported use. Read the Developer Agreement before your first order.
Order quick startLists "Build automated trading strategies" as a next step and recommends a client_order_id on every order for deduplication.Kalshi expects programs to place orders and gives you a tool to make retries safe.
Rulebook v1.31, Rule 5.4Members sending orders or cancellations "whether manually or via automated functionality" must have controls against excessive messaging. The member is responsible for orders confirmed for its account.Rate-limit your own bot, cap order counts, and treat every accepted order as yours.

Sources: Kalshi API docs · Kalshi order quick start · KalshiEX Rulebook v1.31

Kalshi pages read 2026-11-11. Rulebook text quoted from version 1.31. This is a summary for builders, not legal advice; the rulebook and your agreements with Kalshi govern.

Alerts or a trading bot?

Many searches for a Kalshi bot are really asking for alerts. The difference is who presses the button. An alert bot tells a person that something happened. A signal bot writes down the trade it would make and lets you review it. An auto-trading bot signs and sends orders itself. Each step adds code you have to trust with money, so start with the least automation that does the job.

Scroll horizontally to compare →

Alerts, signals and auto-trading compared
SetupHow it worksWhat you need
Alert botA post from a tracked account reaches a Discord channel or your app. A person reads it, opens Kalshi and decides.TweetStream with Discord delivery or a WebSocket client. No Kalshi API key.
Signal botYour code matches the post to a market, reads the order book and writes a paper intent with side, size and evidence. Nothing trades.TweetStream WebSocket, read-only Kalshi market data, a store for intents.
Auto-trading botThe same pipeline signs and submits orders through Kalshi's API inside hard risk limits and a kill switch.Everything above, plus a Kalshi API key, a risk engine, client_order_id handling and reconciliation.

Join the catalyst to the contract

A Kalshi trading bot that reacts to posts needs two separate inputs: Kalshi's official interface for market state and execution, and a fast event feed for the public posts that can change a contract's probability. TweetStream supplies selected X posts, plus supported Truth Social posts on Pro and above. Your strategy decides whether the evidence is relevant and safe to trade.

Scroll horizontally to compare →

Kalshi bot data boundaries
LayerInterfaceJob
Social eventTweetStream WebSocketSelected posts, account events, OCR and trading context
Market stateOfficial Kalshi APIEvents, contracts, order books, positions and exchange status
StrategyYour serviceSource mapping, direction, confidence, freshness and risk
ExecutionOfficial Kalshi APIValidated orders, acknowledgement, fills and reconciliation

Sources: Kalshi developer documentation · Kalshi WebSocket documentation · TweetStream WebSocket quickstart

Public interfaces reviewed 2026-11-11. Kalshi's API covers market data and trade execution over REST, WebSocket and FIX. It has no news or social feed. TweetStream does not supply Kalshi market data or place Kalshi orders.

Kalshi trading bot data flow from social post to order

text
X or Truth Social post
  -> TweetStream WebSocket (tweet/content, tweet/meta, tweet/delete)
  -> your strategy service (source map, freshness, confidence)
  -> risk checks (limits, spread, depth, kill switch)
  -> Kalshi REST or WebSocket (order, acknowledgement, fill)

Kalshi markets that move on posts

Some Kalshi contracts settle on social posts directly. Kalshi's filings with the CFTC define a weekly contract on how many times an account posts on X, a contract on whether a specific post is deleted, and one on an account's follower count. Many more markets react to posts without settling on them: an agency announcing a rule, an official confirming a nominee, a company posting a launch date. For both kinds, a stream of the accounts that matter gives your bot the evidence as it appears.

Scroll horizontally to compare →

Kalshi contracts that settle on social posts
ContractWhat it settles onWhere a real-time stream fits
TWEETSPosts on X by a named account in a period. Main feed posts, quote posts and reposts count. Kalshi counts through the X API, which it calls every five minutes; a deleted post counts if it stayed up long enough to be picked up.Each post reaches your running count as it lands, between Kalshi's five-minute checks. A post you saw that was deleted within minutes may never enter Kalshi's count, so track deleted posts separately.
DELETEPOSTWhether a named post on a named platform is still available through the platform's standard public interface before a date. Sources include the platform, listed news outlets and the account holder's statements.tweet/delete events, sent when observed for accounts you track, are a lead to verify. Settlement follows the public interface and the listed sources.
FOLLOWERCOUNTAn account's publicly displayed follower count on a platform, with the platform first and Social Blade second as sources.A post stream does not carry follower counts. Read the public profile; posts can only tell you why the count might move.

Sources: Kalshi TWEETS filing · Kalshi DELETEPOST filing · Kalshi FOLLOWERCOUNT filing

Contract terms from Kalshi's CFTC filings (TWEETS February 13, 2025; FOLLOWERCOUNT August 22, 2025; DELETEPOST August 26, 2025), read 2026-11-11. Kalshi settles these contracts. TweetStream does not resolve them or reproduce Kalshi's count.

Build the watchlist from the contract rules

Read the contract rules before building the watchlist. A government release may depend on an agency or official; an economic contract may depend on a scheduled report; a company event may depend on a corporate account or executive. A post-count contract names its account, so that account is the whole watchlist. The tighter the source map, the less noise your bot has to classify under time pressure.

  • Store the Kalshi event ticker, market ticker, rules, sources, evidence terms and expiry together
  • Give official and first-party accounts the highest source confidence
  • Add supported Truth Social posts for political contracts; they come with Pro and above
  • Disable mappings as soon as the contract closes or the trading thesis expires

Kalshi API essentials for bots

Four parts of Kalshi's API shape how a bot is built: how requests are signed, how fast you may send them, where you can test without money, and how to retry an order without doubling it. The table summarizes Kalshi's documentation; follow the links for the full reference before writing the client.

Scroll horizontally to compare →

Kalshi API essentials for bot builders
TopicWhat Kalshi documentsWhat to build
Keys and signed requestsEach request carries KALSHI-ACCESS-KEY, KALSHI-ACCESS-TIMESTAMP (milliseconds) and KALSHI-ACCESS-SIGNATURE, a signature over the timestamp, HTTP method and path without the query string. Ed25519 is the recommended default key type; RSA-PSS is the alternative. Kalshi does not store your private key.Keep the private key in a secret store the strategy process cannot read directly, and sign in one small module.
Rate limitsToken buckets per tier, with separate read and write budgets. Basic allows 200 read and 100 write tokens per second; most requests cost 10 tokens. Advanced comes from an upgrade endpoint, Expert to Prestige from 30-day trading-volume share. Over the limit you get HTTP 429 with no Retry-After header.Budget tokens per second in your own client, back off exponentially on 429, and remember batches are billed per item.
Demo environmentA separate environment with mock funds at https://external-api.demo.kalshi.co/trade-api/v2 and wss://external-api-ws.demo.kalshi.co/trade-api/ws/v2. Credentials are not shared with production. Demo prices and behavior may not reflect real markets.Point the whole bot at demo first to test signing, orders, cancels and reconnects. Judge edge on production data only.
Idempotent ordersclient_order_id is optional but recommended. Resubmitting with the same ID is rejected as a duplicate (409 Conflict), which prevents accidental double orders.Derive the ID from your intent, store it before submitting, and retry with the same ID after a timeout.

Sources: Kalshi API keys · Kalshi rate limits · Kalshi demo environment · Kalshi order quick start

Kalshi documentation read 2026-11-11. Figures are for Kalshi's event-contract API; its perpetual futures API has a separate rate-limit table.

Turn one social event into one inspectable intent

Route each TweetStream content event by platform and author, attach later OCR or other enrichment to the same candidate, and read current Kalshi market state before producing a paper intent. The maintained local example covers Kalshi and Polymarket mappings, duplicate rejection, stale-event checks, liquidity limits and position limits without placing an order.

  • Persist a stable event identity before any side effect
  • Reject events outside the strategy's freshness window
  • Read current market state instead of trusting a cached probability
  • Score image OCR and detected trading context as evidence; neither should place an order on its own

Example: from one post to one decision

Take a contract that resolves on whether an agency announces a rule by a set date, with the agency's X account on your watchlist. When that account posts, your bot receives a tweet/content event and works through these steps before any order exists:

  • Match the author and text to the stored mapping for that market ticker, and drop the event if it is outside the freshness window
  • Read the current Kalshi order book and skip the trade if spread or depth breaks your limits
  • Write a paper intent with the event ID, market ticker, side, size cap and the post text as evidence
  • If a later tweet/meta event adds OCR text, attach it to the same candidate and score it again before the intent goes to review

Example: tracking a post-count contract

Now take a TWEETS market on how often an account posts this week. Your bot keeps its own count and compares it with the strike prices on the board. Your count can differ from Kalshi's, because Kalshi settles from its own five-minute checks of the X API, so build in a margin for posts that both sides might count differently.

  • On each tweet/content event from the named account, add one if the post is a main feed post, quote or repost; Kalshi's terms do not count replies
  • On a tweet/delete event, keep the post in the count but flag it, since Kalshi counts deleted posts that lasted long enough to be picked up
  • After each change, recompute the implied distribution for the rest of the period and compare it with the current order book
  • Before the period closes, reconcile your count against the account's public timeline and widen your margin if they disagree

Bot types and where social signals fit

Kalshi bots fall into four broad types. Signal or news bots trade on outside evidence such as posts, data releases or scores; this is the only type TweetStream feeds. Market-making bots quote both sides and earn the spread. Arbitrage bots trade price gaps between related contracts or venues. AI-assisted bots use a model to estimate probabilities and need the same hard limits as any other. Whichever you build, Kalshi's rulebook provides for trading fees, with amounts posted on its website, so put fees into every edge calculation. You can build from scratch, start from an open-source project, or pay for a hosted tool:

Scroll horizontally to compare →

Build, open-source or hosted Kalshi bots
OptionWhat it isFit
Build your ownYour code on Kalshi's official API, with your own data inputs such as a TweetStream WebSocketFull control over signals, risk and latency; you maintain everything
OctagonAI kalshi-trading-bot-cliMIT-licensed TypeScript CLI that researches markets, estimates probabilities, computes edge against live order books and places trades with Kelly sizing and a risk engineA starting point for model-driven trading you can read and modify
ryanfrigo kalshi-ai-trading-botMIT-licensed Python toolkit (CLI, MCP server, Claude skill) built to measure whether a strategy beats the bookEvaluating an edge before committing capital
Bot for KalshiHosted no-code tool: rules in plain language, a Paper mode with no API key, then limit orders through Kalshi's API on your key. $99 a month; Kalshi fees are separateRule-based bots without writing code

Sources: OctagonAI kalshi-trading-bot-cli · ryanfrigo kalshi-ai-trading-bot · Bot for Kalshi · KalshiEX Rulebook v1.31 (fees: Rule 3.13)

Reviewed 2026-11-11 from each project's own page. Descriptions restate what the projects say about themselves; TweetStream has not tested them and makes no performance claims for any of them.

Let an AI coding agent accelerate the build

Use Claude Code, Codex, Cursor or another AI coding agent to scaffold adapters and tests, and keep production capital out of its reach. Give it the public TweetStream envelope contract, the Kalshi client boundary, deterministic fixtures and a paper-only output schema. TweetStream's remote MCP server gives the agent tools to change the streamed accounts and fetch the sandbox connection, and the keyless sandbox streams a fixed list of 50 X accounts 60 seconds late, so the agent can run the pipeline end to end without a key. Keep secrets and irreversible actions outside its tool access.

Measure the path that can win or lose the trade

Record source publication, local TweetStream receipt, decision completion, Kalshi order submission, exchange acknowledgement and fill as separate timestamps. TweetStream detects X posts in typically 166 ms, measured from X's post timestamp to first receipt on a TweetStream server. Live figures are at tweetstream.io/speedcheck. That figure stops at the TweetStream server; your signal-to-fill result also includes network transit to your host, strategy, risk and venue time.

Earn the right to place the first order

A production bot should fail closed on ambiguity. Run the whole bot against Kalshi's demo environment first to prove signing, order placement, cancels and reconnects; Kalshi says demo prices and behavior may not match real markets, so do not read profit or loss from it. Then replay history, shadow the live feed and paper-trade on production data. Go live with hard exposure and daily-loss limits. No model score should bypass market-open checks, minimum liquidity, maximum spread, stale-event rejection, idempotent order handling or a kill switch controlled outside the strategy process.

Implementation asset: prediction-market source router

Turn validated X and supported Truth Social events into typed, venue-neutral routing decisions. Adapt the source list, market mapping, and keyword rules to your strategy, then keep duplicate, stale-event, position-limit, credential, and execution controls in deterministic code around this pattern.

ts
type SocialPlatform = "twitter" | "truth_social" | "binance_square";
 
type TweetStreamContentEvent = {
  d: {
    author: { handle?: string; platform: SocialPlatform };
    createdAt: number;
    kind: "post" | "quote" | "reply" | "retweet";
    text: string;
    tweetId: string;
  };
  id?: string;
  op: "content";
  t: "tweet";
  ts: number;
  v: 1;
};
 
const sourceRules = [
  {
    handles: ["whitehouse", "potus"],
    platform: "twitter",
    strategy: "policy-markets",
    terms: ["executive order", "tariff"],
    venue: "polymarket",
  },
  {
    handles: ["realdonaldtrump"],
    platform: "truth_social",
    strategy: "trade-policy",
    terms: ["trade policy", "announcement"],
    venue: "kalshi",
  },
] as const;
 
export function routePredictionMarketSourceEvent(event: TweetStreamContentEvent) {
  const handle = event.d.author.handle?.toLowerCase().replace(/^@/, "");
  const platform = event.d.author.platform;
  const text = event.d.text.toLowerCase();
  const rule = sourceRules.find(
    (candidate) =>
      candidate.platform === platform &&
      candidate.handles.some((candidateHandle) => candidateHandle === handle),
  );
  const matchedTerm = rule?.terms.find((term) => text.includes(term));
 
  if (!rule || !matchedTerm) {
    return { deliver: false } as const;
  }
 
  return {
    deliver: true,
    eventId: event.d.tweetId,
    matchedTerm,
    strategy: rule.strategy,
    venue: rule.venue,
  } as const;
}

Questions

Does Kalshi allow bots?
Yes. Kalshi documents its API for real-time market data and trade execution and lists building automated trading strategies as a next step in its order quick start. Its rulebook covers orders sent manually or via automated functionality and requires controls against excessive messaging. API use binds you to Kalshi's Developer Agreement, and the member stays responsible for every order the bot places.
Is there a Kalshi API for trading bots?
Yes. Kalshi offers REST, WebSocket and FIX interfaces for its event-contract markets, documented at docs.kalshi.com. Requests are signed with an API key: Ed25519 is the recommended default and RSA-PSS is the alternative.
Is there a Kalshi demo or paper-trading environment?
Yes. Kalshi runs a demo environment with mock funds and its own accounts and keys, since credentials are not shared with production. Kalshi warns that demo prices and market behavior may not reflect real markets, so use it to test order handling, not to judge a strategy's edge.
What are the Kalshi API rate limits?
Kalshi uses token buckets per tier. As of November 2026, the Basic tier allows 200 read and 100 write tokens per second, and most requests cost 10 tokens, so Basic supports about 10 orders per second. Higher tiers come from an upgrade endpoint (Advanced) or from trading-volume share (Expert to Prestige). Going over returns HTTP 429 with no Retry-After header, so back off exponentially.
Which APIs does a Kalshi trading bot need?
Two. Use TweetStream for selected X posts, plus supported Truth Social posts on Pro and above, that may change a contract's probability. Use Kalshi's official API for events, markets, order books, portfolio state and orders, and join both inputs in your own strategy service.
Which social accounts should a Kalshi bot monitor?
Start from each contract's rules and resolution source. Track the agencies, officials, companies, teams and reporters most likely to publish decisive evidence. For a post-count contract, the account named in the contract is the watchlist. Add commentary accounts only when they improve recall without flooding the strategy.
Can an AI coding agent build the Kalshi bot?
Yes. An AI coding agent can adapt the fixture-backed example, write source mappings and generate tests, and it can explore live data through TweetStream's MCP server or the keyless sandbox, which streams 50 fixed X accounts 60 seconds late. It should output paper intents or typed proposals. Credentials, position limits, order approval and the kill switch stay in deterministic code.
Are Kalshi trading bots profitable?
Nobody can promise that. Kalshi's rulebook provides for trading fees, and spread, depth and fees decide whether a signal is still worth trading by the time your order reaches the book. Measure every stage, paper-trade first and size live positions so a losing month is survivable.

Run this workflow with TweetStream

TweetStream delivers posts, deletes, pins, profile and follow changes, and token and OCR enrichment as WebSocket events. Try it with the accounts from this guide.

$199/mo for 50 accounts after a 3-day, 5-account trial