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.

How It Works


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.
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.
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 Repogit clone https://github.com/linq-team/kalshi-agent.gitcd linq-builders-cookbook && npm installcp .env.example .env # add Linq + Anthropic + Kalshi keysnpm run devSimple Integration
Kalshi Agent → iMessage
Try it yourself
Clone the repo, add your API keys, and deploy your own Kalshi trading agent on iMessage in minutes.