Trade Prediction Markets
via Text Message

Kai is an open-source trading agent with 14 Claude tools, RSA-PSS signed Kalshi API calls, and rich iMessage features — built on Linq. Search markets, place trades, and track your portfolio entirely via text.

Kalshi trading agent on iMessage

How It Works

RSA-PSS + SHA-256AES-256-GCM CredentialsPer-Request SigningDynamoDB Storage
iMessageUser
LinqWebhook
Your ServerExpress
ClaudeSonnet 4
Kalshi
KalshiTrading API
01

Clone & Configure

Clone the repo, add your Linq API token, Anthropic key, and Kalshi RSA private key to .env. Start the Express server and expose it with ngrok.

02

Webhook Connects Everything

Set your ngrok URL as the webhook in Linq. When someone texts your number, Linq forwards the message to your server — including images and voice memos.

03

Claude Trades for You

Claude Sonnet 4 receives the message with 14 tools available — from searching Kalshi markets to placing RSA-PSS signed trades. Replies are sent back as iMessages.

Under the Hood

14 Claude Tools

10 Kalshi tools (trending, search, market details, order books, buy, sell, cancel, open orders, fills, portfolio) plus 4 messaging tools — reactions, effects, memory, and web search.

RSA-PSS Signed Requests

Every Kalshi API call is cryptographically signed with RSA-PSS + SHA-256. Kai generates timestamped signatures per request — no API keys stored in plaintext.

Rich Link Previews

URLs are automatically extracted and sent as separate iMessage bubbles, triggering native rich link previews for Kalshi markets, news articles, and more.

Multi-Message Responses

Claude's replies are split on --- delimiters and sent sequentially with typing indicators between each — mimicking how a human would actually text back.

Group Chat Intelligence

In group chats, a fast Haiku classifier decides whether to respond, react with a tapback, or stay silent — so Kai doesn't hijack every conversation.

Magic Link Onboarding

New users receive a secure magic link to connect their Kalshi account. Credentials are encrypted with AES-256-GCM and stored per-user in DynamoDB.

Up and running in minutes

Clone the repo, add your API keys, and start receiving iMessages on your local server.

Clone the Repo
$git clone https://github.com/linq-team/kalshi-agent.git
$cd linq-builders-cookbook && npm install
$cp .env.example .env # add Linq + Anthropic + Kalshi keys
$npm run dev

Simple Integration

Kalshi Agent → iMessage

01
User texts Kai via iMessage
02
Linq webhook → parallelmarkAsRead, startTyping, getChat, getUserProfile
03
Group chat?Haiku classifier decides: respond, react, or ignore
04
Auth check → new user?Send magic link for Kalshi credentials
05
Claude Sonnet 4 processes with 14 toolsup to 5 tool-use iterations
06
Response split on --- into multiple messages;URLs sent separately for rich previews
07
Messages sent via Linq API → user receives on iMessage

Try it yourself

Clone the repo, add your API keys, and deploy your own Kalshi trading agent on iMessage in minutes.

Your Cart
Your cart's looking a little light.Looks like your cart is empty—it's time to add your
gears and make it unforgettable.
Shop our best sellers
Digital Card
Digital Card$14.99
Hub
Hub$29.99
Badge
Badge$19.99
Mini Card
Mini Card$12.99