Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Trade prediction markets on Kalshi using the kalshi-cli command-line tool. Use when the user wants to trade event contracts, browse prediction markets, place orders, manage positions, stream live prices, or view candlestick charts. Also use when they mention "prediction market," "event contract," "kalshi," "YES/NO," "order book," "limit order," "market order," "hedge," "arbitrage," or "liquidity rewards."
.claude/skills/kalshi-trading/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-14 | ✗→✓ | ▲ Improved | — | — |
| case-11 | ✗→✓ | ▲ Improved | — | — |
| case-19 | ✗→✓ | ▲ Improved | — | — |
| case-13 | ✗→✓ | ▲ Improved | — | — |
| case-12 | ✗→✓ | ▲ Improved | — | — |
Trade CFTC-regulated prediction markets on Kalshi through the kalshi-cli command-line tool. Browse markets, place limit and market orders, manage positions, stream real-time prices, and view ASCII candlestick charts — all from the terminal.
Kalshi is fully legal in the US. No crypto wallets, no blockchain, no gas fees — everything settles in USD.
bashbrew install 6missedcalls/tap/kalshi-cli
bashgo install github.com/6missedcalls/kalshi-cli/cmd/kalshi-cli@latest
bashgit clone https://github.com/6missedcalls/kalshi-cli.git cd kalshi-cli go build -o kalshi-cli ./cmd/kalshi-cli
bashkalshi-cli auth login
Follow the prompts to:
Credentials are stored securely in your OS keyring (macOS Keychain, GNOME Keyring, or Windows Credential Manager).
bash# Via flags kalshi-cli auth login --api-key-id YOUR_KEY_ID --private-key-file /path/to/key.pem # Via PEM content kalshi-cli auth login --api-key-id YOUR_KEY_ID --private-key "$(cat /path/to/key.pem)" # Via environment variables export KALSHI_API_KEY_ID=your-key-id export KALSHI_PRIVATE_KEY="$(cat /path/to/key.pem)" kalshi-cli auth login
Add to ~/.kalshi/config.yaml:
yamlapi_key_id: your-key-id private_key_path: /path/to/key.pem
Credentials are resolved in order: config file, environment variables, OS keyring.
| | Demo (default) | Production | |--|------|-----------| | Flag | (default) | --prod | | API | demo-api.kalshi.co | api.elections.kalshi.com | | Money | Fake/test | Real USD |
The CLI defaults to demo mode. You must pass --prod to trade with real money. This is a safety feature.
You are an expert in using kalshi-cli for prediction market trading on Kalshi. Your goal is to help users trade event contracts efficiently while emphasizing safety and risk awareness.
--prod when the user explicitly wants real trading.auth status), exchange is active (exchange status), and sufficient balance exists.--json for machine-readable output.KXBTC-26FEB12-B97000. Events group related markets.Use this skill when the user wants to:
Common trigger phrases:
When NOT to use this skill:
Markets use structured tickers: KXBTC-26FEB12-B97000
KXBTC = series (Bitcoin)26FEB12 = date (Feb 12, 2026)B97000 = strike ($97,000)An event groups related markets. For example, "Bitcoin price on Feb 12" is an event containing markets at different strike prices ($90K, $95K, $100K, etc.).
Kalshi trades event contracts priced 1-99 cents, settling to $1 or $0. All values are in cents.
Up to 32 subaccounts per user for multi-strategy isolation.
Cap total fills across multiple orders — useful for market-making where you don't want both sides filled.
Every command accepts these flags:
| Flag | Short | Default | Description | |------|-------|---------|-------------| | --json | | false | Output as JSON for scripts | | --plain | | false | Plain text for piping | | --yes | -y | false | Skip all confirmation prompts | | --prod | | false | Use production API (real money) | | --verbose | -v | false | Debug output | | --config | | ~/.kalshi/config.yaml | Config file path |
bashkalshi-cli auth login # interactive login kalshi-cli auth login --api-key-id ID --private-key-file /path/to/key.pem # non-interactive kalshi-cli auth logout # remove stored credentials kalshi-cli auth status # check auth status + environment kalshi-cli auth keys list # list API keys kalshi-cli auth keys create --name "my-bot" # create new API key kalshi-cli auth keys delete KEY_ID # delete API key
List markets:
bashkalshi-cli markets list --status open --limit 20 kalshi-cli markets list --series KXBTC --json
Flags: --status (open/closed/settled), --series (filter by series ticker), --limit (default 50).
Get market details:
bashkalshi-cli markets get KXBTC-26FEB12-B97000
View order book:
bashkalshi-cli markets orderbook KXBTC-26FEB12-B97000 kalshi-cli markets orderbook KXBTC-26FEB12-B97000 --json
View recent trades:
bashkalshi-cli markets trades KXBTC-26FEB12-B97000 --limit 20
View candlestick chart:
bashkalshi-cli markets candlesticks KXBTC-26FEB12-B97000 --series KXBTC kalshi-cli markets candlesticks KXBTC-26FEB12-B97000 --series KXBTC --period 1d # Periods: 1m, 1h, 1d
Browse series (categories of markets):
bashkalshi-cli markets series list --category Economics kalshi-cli markets series list --category Crypto kalshi-cli markets series list --category Politics kalshi-cli markets series get KXBTC
List events:
bashkalshi-cli events list --limit 20 kalshi-cli events list --status active
Flags: --status (active/closed/settled), --limit, --cursor.
Get event details:
bashkalshi-cli events get KXBTC-26FEB12
Event candlestick chart:
bashkalshi-cli events candlesticks KXINXU-26FEB11H1600 --period 1h \ --start 2026-02-10T00:00:00Z --end 2026-02-11T23:00:00Z
Multivariate events:
bashkalshi-cli events multivariate list --limit 10 kalshi-cli events multivariate get TICKER
Place a limit order:
bashkalshi-cli orders create --market KXBTC-26FEB12-B97000 --side yes --qty 10 --price 50
Place a market order:
bashkalshi-cli orders create --market KXBTC-26FEB12-B97000 --side yes --qty 10 --type market
Sell contracts:
bashkalshi-cli orders create --market KXBTC-26FEB12-B97000 --side no --qty 5 --price 30 --action sell
Skip confirmation (for bots):
bashkalshi-cli orders create --market KXBTC-26FEB12-B97000 --side yes --qty 10 --price 50 --yes --json
Production trading (real money):
bashkalshi-cli --prod orders create --market KXBTC-26FEB12-B97000 --side yes --qty 10 --price 50
Order flags:
| Flag | Required | Default | Description | |------|----------|---------|-------------| | --market | Yes | | Market ticker | | --side | Yes | | yes or no | | --qty | Yes | | Number of contracts | | --price | Yes (limit) | | Price in cents (1-99) | | --action | No | buy | buy or sell | | --type | No | limit | limit or market |
Amend an order:
bashkalshi-cli orders amend ORDER_ID --price 55 kalshi-cli orders amend ORDER_ID --qty 20 kalshi-cli orders amend ORDER_ID --price 55 --qty 20
Cancel orders:
bashkalshi-cli orders cancel ORDER_ID kalshi-cli orders cancel-all kalshi-cli orders cancel-all --market KXBTC-26FEB12-B97000
List and inspect orders:
bashkalshi-cli orders list --status resting kalshi-cli orders list --market KXBTC-26FEB12-B97000 --json kalshi-cli orders get ORDER_ID kalshi-cli orders queue ORDER_ID # check queue position
Batch create orders from JSON file:
bashkalshi-cli orders batch-create --file orders.json
The JSON file format:
json[ { "ticker": "MARKET1", "side": "yes", "action": "buy", "type": "limit", "count": 10, "yes_price": 50 }, { "ticker": "MARKET2", "side": "no", "action": "buy", "type": "limit", "count": 5, "no_price": 30 } ]
Check balance:
bashkalshi-cli portfolio balance kalshi-cli portfolio balance --json
All values are in cents. Example JSON:
json{ "available_balance": 10000, "portfolio_value": 5000, "total_balance": 15000 }
View positions:
bashkalshi-cli portfolio positions kalshi-cli portfolio positions --market KXBTC-26FEB12-B97000
View trade fills:
bashkalshi-cli portfolio fills --limit 50
View settlements (resolved market payouts):
bashkalshi-cli portfolio settlements --limit 20
Subaccount management:
bashkalshi-cli portfolio subaccounts list kalshi-cli portfolio subaccounts create kalshi-cli portfolio subaccounts transfer --from 1 --to 2 --amount 50000 # $500 in cents
Order groups cap total fills across multiple orders — useful for market-making. Alias: og.
bashkalshi-cli order-groups create --limit 100 # max 100 contracts across group kalshi-cli order-groups list kalshi-cli og list --status active # alias kalshi-cli order-groups get GROUP_ID kalshi-cli order-groups update-limit GROUP_ID --limit 200 kalshi-cli order-groups reset GROUP_ID # reset filled count kalshi-cli order-groups trigger GROUP_ID # execute orders kalshi-cli order-groups delete GROUP_ID # cancels all orders in group
bashkalshi-cli rfq create --market KXBTC-26FEB12-B97000 --qty 1000 kalshi-cli rfq list --status open kalshi-cli rfq get RFQ_ID kalshi-cli rfq delete RFQ_ID
bashkalshi-cli quotes list --rfq-id RFQ_ID kalshi-cli quotes create --rfq RFQ_ID --price 65 kalshi-cli quotes accept QUOTE_ID kalshi-cli quotes confirm QUOTE_ID
All watch commands require auth. Press Ctrl+C to stop. Auto-reconnects with exponential backoff.
bashkalshi-cli watch ticker KXBTC-26FEB12-B97000 # live price updates kalshi-cli watch orderbook KXBTC-26FEB12-B97000 # orderbook deltas kalshi-cli watch trades # all public trades kalshi-cli watch trades --market KXBTC-26FEB12-B97000 # trades for one market kalshi-cli watch orders # your order status changes kalshi-cli watch fills # your fill notifications kalshi-cli watch positions # your position changes # JSON output for programmatic consumption kalshi-cli watch ticker KXBTC-26FEB12-B97000 --json
bashkalshi-cli exchange status # exchange status, trading active? kalshi-cli exchange schedule # trading schedule kalshi-cli exchange announcements # latest announcements
bashkalshi-cli config show # all settings kalshi-cli config get output.format # get a setting kalshi-cli config set output.format json # change default output kalshi-cli config set defaults.limit 100 # change default list limit
Config file: ~/.kalshi/config.yaml
bashkalshi-cli version # print version kalshi-cli completion bash # shell autocompletion kalshi-cli completion zsh
| Variable | Description | |----------|-------------| | KALSHI_API_KEY_ID | API Key ID | | KALSHI_PRIVATE_KEY | Private key PEM content | | KALSHI_PRIVATE_KEY_FILE | Path to private key PEM file | | KALSHI_API_PRODUCTION | true for production | | KALSHI_API_TIMEOUT | HTTP timeout (e.g., 60s) | | KALSHI_OUTPUT_FORMAT | Default output format |
All commands support --json, --plain, and default table output.
bash# Human-readable table (default) kalshi-cli markets list --limit 5 # Machine-readable JSON kalshi-cli --json markets list --limit 5 # Plain text for piping kalshi-cli --plain portfolio balance
Exit codes: 0=success, 1=general error, 2=auth error, 3=validation error, 4=API error, 5=network error.
bash# 1. Browse by category kalshi-cli markets series list --category Crypto # 2. List open markets in a series kalshi-cli markets list --series KXBTC --status open # 3. Get market details kalshi-cli markets get KXBTC-26FEB12-B97000 # 4. Check the order book kalshi-cli markets orderbook KXBTC-26FEB12-B97000 # 5. View candlestick chart kalshi-cli markets candlesticks KXBTC-26FEB12-B97000 --series KXBTC --period 1h # 6. View recent trades kalshi-cli markets trades KXBTC-26FEB12-B97000 --limit 10
bash# 1. Check balance kalshi-cli portfolio balance # 2. Place limit order (demo mode) kalshi-cli orders create --market KXBTC-26FEB12-B97000 --side yes --qty 10 --price 50 # 3. Check order status kalshi-cli orders list --status resting # 4. Check queue position kalshi-cli orders queue ORDER_ID # 5. Amend if needed kalshi-cli orders amend ORDER_ID --price 52 # 6. Or cancel kalshi-cli orders cancel ORDER_ID
bash# 1. Create an order group (cap total fills) kalshi-cli order-groups create --limit 50 # 2. Place orders on both sides kalshi-cli orders create --market TICKER --side yes --action buy --qty 10 --price 45 --yes kalshi-cli orders create --market TICKER --side yes --action sell --qty 10 --price 55 --yes # 3. Monitor fills kalshi-cli watch fills
bash#!/bin/bash MARKET="KXBTC-26FEB12-B97000" BOOK=$(kalshi-cli markets orderbook $MARKET --json) BEST_BID=$(echo $BOOK | jq '.yes_bids[0].price // 0') BEST_ASK=$(echo $BOOK | jq '.yes_asks[0].price // 100') kalshi-cli orders create --market $MARKET --side yes --action buy --qty 10 --price $((BEST_BID + 1)) --yes --json kalshi-cli orders create --market $MARKET --side yes --action sell --qty 10 --price $((BEST_ASK - 1)) --yes --json
bash# Terminal display kalshi-cli watch ticker KXBTC-26FEB12-B97000 # Pipe JSON to a script kalshi-cli watch ticker KXBTC-26FEB12-B97000 --json | while read line; do PRICE=$(echo $line | jq '.yes_price') echo "Current price: $PRICE" done
bashkalshi-cli portfolio balance --json | jq '{available: .available_balance, total: .total_balance}' kalshi-cli portfolio positions --json | jq '.[] | {ticker, position, pnl}' kalshi-cli portfolio fills --limit 10 kalshi-cli portfolio settlements --limit 10
bash# Verify you're on demo first kalshi-cli auth status # Switch to production for a single command kalshi-cli --prod orders create --market KXBTC-26FEB12-B97000 --side yes --qty 10 --price 50 # Or set globally export KALSHI_API_PRODUCTION=true
--prod — always verify with kalshi-cli auth status before trading real money.--yes carefully — it skips all confirmations. Only use in tested bot scripts.kalshi-cli watch positions for real-time tracking.orders amend is atomic and faster.orders batch-create with a JSON file for multiple orders.orders queue to see where your resting order sits.--json --yes — machine-parseable output, no interactive prompts.watch ticker is more efficient than polling.| Task | Command | |------|---------| | Auth | | Login | kalshi-cli auth login | | Check status | kalshi-cli auth status | | List API keys | kalshi-cli auth keys list | | Markets | | List markets | kalshi-cli markets list --status open --limit 20 | | Get market | kalshi-cli markets get TICKER | | Order book | kalshi-cli markets orderbook TICKER | | Recent trades | kalshi-cli markets trades TICKER --limit 20 | | Candlestick chart | kalshi-cli markets candlesticks TICKER --series SERIES --period 1h | | Browse series | kalshi-cli markets series list --category Crypto | | Events | | List events | kalshi-cli events list --status active --limit 20 | | Get event | kalshi-cli events get EVENT_TICKER | | Event chart | kalshi-cli events candlesticks EVENT_TICKER --period 1h | | Trading | | Limit order (buy YES) | kalshi-cli orders create --market TICKER --side yes --qty 10 --price 50 | | Market order | kalshi-cli orders create --market TICKER --side yes --qty 10 --type market | | Sell contracts | kalshi-cli orders create --market TICKER --side no --qty 5 --price 30 --action sell | | Amend order | kalshi-cli orders amend ORDER_ID --price 55 | | Cancel order | kalshi-cli orders cancel ORDER_ID | | Cancel all | kalshi-cli orders cancel-all | | Batch create | kalshi-cli orders batch-create --file orders.json | | List resting orders | kalshi-cli orders list --status resting | | Queue position | kalshi-cli orders queue ORDER_ID | | Portfolio | | Balance | kalshi-cli portfolio balance | | Positions | kalshi-cli portfolio positions | | Fills | kalshi-cli portfolio fills --limit 50 | | Settlements | kalshi-cli portfolio settlements | | Subaccounts | | List | kalshi-cli portfolio subaccounts list | | Create | kalshi-cli portfolio subaccounts create | | Transfer | kalshi-cli portfolio subaccounts transfer --from 1 --to 2 --amount 50000 | | Order Groups | | Create group | kalshi-cli order-groups create --limit 100 | | List groups | kalshi-cli og list | | Update limit | kalshi-cli order-groups update-limit GROUP_ID --limit 200 | | Delete group | kalshi-cli order-groups delete GROUP_ID | | Block Trading | | Create RFQ | kalshi-cli rfq create --market TICKER --qty 1000 | | List RFQs | kalshi-cli rfq list | | Create quote | kalshi-cli quotes create --rfq RFQ_ID --price 65 | | Accept quote | kalshi-cli quotes accept QUOTE_ID | | Streaming | | Live prices | kalshi-cli watch ticker TICKER | | Orderbook deltas | kalshi-cli watch orderbook TICKER | | Public trades | kalshi-cli watch trades | | Your orders | kalshi-cli watch orders | | Your fills | kalshi-cli watch fills | | Your positions | kalshi-cli watch positions | | Exchange | | Exchange status | kalshi-cli exchange status | | Schedule | kalshi-cli exchange schedule | | Announcements | kalshi-cli exchange announcements | | Config | | Show config | kalshi-cli config show | | Set value | kalshi-cli config set output.format json |
--prod flag for real trading.KXBTC-26FEB12-B97000 = series + date + strike.| Type | Formula | Max at 50/50 | |------|---------|--------------| | Taker | roundup(0.07 * C * P * (1-P)) | 1.75c/contract | | Maker | roundup(0.0175 * C * P * (1-P)) | ~0.44c/contract | | S&P/Nasdaq markets | Half the normal rate | ~0.88c taker |
Lower fees for orders near the extremes (close to 0 or 100). No settlement or withdrawal fees (ACH).
bashkalshi-cli auth status # check status kalshi-cli auth login # re-authenticate
bashkalshi-cli auth status # shows current environment # Use --prod for production, omit for demo
kalshi-cli portfolio balancekalshi-cli markets get TICKERkalshi-cli exchange status| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-14 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +83 percentage points is the difference between those two pass rates over the 23 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.