NEW: Live arbitrage across 10+ prediction markets.Arbitrage →
← Index
APISep 26, 2026

Kalshi SDK (2026): Which One to Install and Why

Kalshi SDK (2026): Which One to Install and Why

The Short Answer

Kalshi publishes three official SDKs: kalshi_python_sync and kalshi_python_async on PyPI, and kalshi-typescript on npm. All three sat at version 3.30.0 when this was written, released on 15 September 2026, and all three authenticate with an API key and RSA-PSS request signing. The older kalshi-python package is deprecated. Kalshi itself notes that its SDKs can lag the API and treats its OpenAPI specification as the source of truth. If you need Kalshi alongside other venues, Predictefy's SDK reads Kalshi together with 15+ prediction market venues through one client and one schema.

Key Takeaways

  • Install kalshi_python_sync for plain Python, kalshi_python_async for asyncio, or kalshi-typescript for Node.js. Skip kalshi-python, which Kalshi has deprecated.
  • Both Python SDKs require Python 3.13 or newer. On Python 3.12, pip quietly installs an old 3.2.0 release instead of failing.
  • Orders live under V2 method names: create_order_v2 in Python and createOrderV2 in TypeScript, both posting to /portfolio/events/orders.
  • Use external-api.kalshi.com for production and external-api.demo.kalshi.co for the demo exchange. Credentials do not carry across.
  • For Kalshi plus Polymarket and other venues, one Predictefy client replaces a separate SDK per venue.

Which Kalshi SDK should you install?

Pick by language, and in Python by whether your code is async. All three packages are generated from Kalshi's OpenAPI specification and released together, generally on a Tuesday or Wednesday each week, ahead of the API changes they cover.

pip install kalshi_python_sync     # blocking calls, the simplest place to start
pip install kalshi_python_async    # asyncio, for services that run many requests at once
npm install kalshi-typescript      # Node.js and TypeScript, built on axios

kalshi_python_async is the asyncio edition of the same client. The TypeScript package is split into API classes such as MarketApi, PortfolioApi and OrdersApi, each built from one shared Configuration.

Here is the field you will run into when you search a package registry:

PackageRegistryLatestUse it for
kalshi_python_syncPyPI3.30.0, 15 Sep 2026Scripts, notebooks and simple bots. Python 3.13 or newer
kalshi_python_asyncPyPI3.30.0, 15 Sep 2026asyncio services. Python 3.13 or newer
kalshi-typescriptnpm3.30.0, 15 Sep 2026Node.js and TypeScript services
kalshi-pythonPyPI2.1.4, Sep 2025Deprecated by Kalshi. Do not start new work on it

What happened to kalshi-python?

It was the original Python SDK, and it is still the one most older tutorials import. Kalshi's SDK page now marks it deprecated and points to the sync and async packages instead. Its last release, 2.1.4, dates from September 2025, while the current packages track the API every week.

If an example you are copying imports kalshi_python, translate it to kalshi_python_sync rather than installing the old package. The client class and configuration pattern carry over; the method set is what has moved on.

Why does pip install an old version of the Kalshi SDK?

Because the current Python packages require Python 3.13 or newer, and pip does not stop to tell you. On Python 3.12, pip install kalshi_python_sync succeeds, but what it installs is 3.2.0, the newest release that still supports 3.12, rather than 3.30.0. Code copied from today's documentation can then call methods that version does not have.

python --version                           # needs 3.13 or newer
pip install "kalshi_python_sync==3.30.0"   # pinning makes an old interpreter fail loudly
pip show kalshi_python_sync                # confirm the version you actually got

Pinning the exact version turns a silent downgrade into a clear error, which is what you want in a requirements file. pip show is the quickest way to check an existing environment.

How do you authenticate with the Kalshi Python SDK?

Every Kalshi SDK signs requests with an API key ID and an RSA private key, using RSA-PSS. Create the key in your Kalshi account, following how to get a Kalshi API key, keep the private key file out of your repository, and hand both to the client:

from kalshi_python_sync import Configuration, KalshiClient

config = Configuration(host="https://external-api.kalshi.com/trade-api/v2")
config.api_key_id = "YOUR_API_KEY_ID"
with open("kalshi-private-key.pem") as f:
    config.private_key_pem = f.read()

client = KalshiClient(config)

markets = client.get_markets(limit=5, status="open")
first = markets.markets[0]
book = client.get_market_orderbook(ticker=first.ticker)
balance = client.get_balance()

KalshiClient bundles every API group, from markets and portfolio to orders and historical data, and forwards each call to the right one, so get_markets and get_balance sit on the same object. Kalshi recommends the external-api host for API traders. The older api.elections.kalshi.com host still works and, despite its name, serves every Kalshi market. Signatures cover the path from /trade-api/v2 onward, never the hostname or query string, and the SDK builds them for you.

Market status accepts unopened, open, paused, closed and settled. For rate limits and the tier system behind them, see Kalshi API rate limits.

What does the Kalshi TypeScript SDK look like?

The TypeScript client is generated with positional arguments and returns axios responses, which makes it more verbose than the Python client but just as complete:

import { readFileSync } from 'node:fs';
import { Configuration, MarketApi, PortfolioApi } from 'kalshi-typescript';

const config = new Configuration({
  apiKey: process.env.KALSHI_API_KEY_ID,
  privateKeyPem: readFileSync('kalshi-private-key.pem', 'utf8'),
  basePath: 'https://external-api.kalshi.com/trade-api/v2',
});

const markets = new MarketApi(config);
const { data } = await markets.getMarkets(5);
const book = await markets.getMarketOrderbook(data.markets[0].ticker);

const portfolio = new PortfolioApi(config);
const balance = await portfolio.getBalance();

getMarkets takes limit, cursor, event ticker and series ticker in that order, then a longer list of filters, so pass undefined for any you skip. Every call resolves to an axios response with the payload on .data. The default base path is already the production external-api host.

Can the Kalshi SDK place orders?

Yes. Order methods use V2 names that reflect Kalshi's newer order endpoints, which is why a quick search for create_order comes up empty.

ActionPythonTypeScript (OrdersApi)
Create an ordercreate_order_v2createOrderV2
Amend price or sizeamend_order_v2amendOrderV2
Reduce sizedecrease_order_v2decreaseOrderV2
Cancel one ordercancel_order_v2cancelOrderV2
Create or cancel in batchesbatch_create_orders_v2, batch_cancel_orders_v2batchCreateOrdersV2, batchCancelOrdersV2
Queue positionget_order_queue_positiongetOrderQueuePosition

Creating an order posts to /portfolio/events/orders. The same client also covers order groups, request for quote and your portfolio's fills, positions and settlements. If a partially filled order is confusing you, reading the Kalshi order book first usually explains why.

How do you test against the Kalshi demo exchange?

Change the host and the key, nothing else. Kalshi runs a separate demo exchange with mock funds at https://external-api.demo.kalshi.co/trade-api/v2, with WebSockets at wss://external-api-ws.demo.kalshi.co/trade-api/ws/v2. Demo and production credentials are separate, so create an API key inside your demo account.

Kalshi notes that demo prices and behaviour may not reflect real markets, which makes the demo ideal for testing authentication and order flow, and less useful for judging a strategy. The difference, and how to paper trade against Kalshi's real order books instead, is covered in Kalshi paper trading.

When should you skip the Kalshi SDK?

Kalshi's own guidance is that production traders should treat the OpenAPI and AsyncAPI specifications as the source of truth, and consider generating their own client or integrating directly for full control. Two situations push most teams that way: an endpoint the SDK has not caught up with yet, and a strategy that needs more than one venue.

The second case is where one multi-venue client pays off. Predictefy's SDK reads Kalshi and Polymarket, together with 15+ prediction market venues, through the same methods:

import { Predictefy } from '@predictefy/sdk';

const client = new Predictefy({ apiKey: process.env.PREDICTEFY_API_KEY });

const kalshi = await client.kalshi.fetchMarkets({ query: 'fed', status: 'active', limit: 5 });
const polymarket = await client.polymarket.fetchMarkets({ query: 'fed', status: 'active', limit: 5 });

Both calls return the same market shape, with every outcome carrying an outcomeId and a price between 0 and 1, so comparison code is written once. The TypeScript package is @predictefy/sdk 1.0.0-beta.9 and the Python package is predictefy 1.0.0b7. Orders go through client-signed execution, built server side and signed in your own process, and paper trading runs against live order books at 0 credits.

For a side-by-side of the two venues' raw APIs, see Kalshi API vs Polymarket API, and for the case for one integration across every venue, is there one API for all prediction markets.

Frequently Asked Questions

What is the official Kalshi SDK?

Kalshi publishes three official SDKs: kalshi_python_sync and kalshi_python_async on PyPI, and kalshi-typescript on npm. All three are generated from Kalshi's OpenAPI specification, released together each week, and authenticate with an API key and RSA-PSS signing. The older kalshi-python package is deprecated and should not be used for new work.

Why does pip install an old version of kalshi_python_sync?

The current release requires Python 3.13 or newer. On Python 3.12 or older, pip falls back to 3.2.0, the newest version your interpreter supports, without an error. Upgrade Python first, then pin kalshi_python_sync==3.30.0 so an unsupported interpreter fails loudly instead of installing an outdated client.

Can the Kalshi Python SDK place orders?

Yes. Order methods use V2 names: create_order_v2, amend_order_v2, decrease_order_v2 and cancel_order_v2, plus batch versions for creating and cancelling several orders at once. Creating an order posts to Kalshi's portfolio events orders endpoint. The TypeScript SDK exposes the same set as createOrderV2 and its siblings on OrdersApi.

Does the Kalshi SDK work with the demo environment?

Yes. Set the host to https://external-api.demo.kalshi.co/trade-api/v2 and use an API key created in your demo account. Demo and production credentials are separate, so a production key fails against demo and the reverse. Kalshi notes that demo prices and behaviour may differ from real markets.

Is there one SDK for Kalshi and Polymarket?

Predictefy's SDK covers both, together with 15+ prediction market venues, through one client. client.kalshi and client.polymarket expose the same methods and return the same normalized market and order book shapes, so comparison and trading code is written once. It ships as @predictefy/sdk on npm and predictefy on PyPI.