# BotCookery > Free AI build recipes for trading & prediction-market bots, with guardrails. Free, copy-paste recipes for building your own Kalshi and Polymarket US bots with Claude Code, Cursor, Codex/ChatGPT and Grok. Paper/demo trading first, safety pack included. Educational only: no financial advice, no picks or signals, no hosted bots, no copy trading. Every recipe has a short answer, key facts, a prompt for your AI coding tool, steps, a paper/demo setup, a safety checklist, FAQs and links to the official docs it was checked against (last checked 2026-10-19 unless the recipe says otherwise). If a recipe disagrees with official docs, the docs win. ## Recipes - [Polymarket API Starter Kit: Pull Markets, Prices & Order Books with AI (2026)](https://botcookery.com/recipes/polymarket-api-starter-kit/): The Polymarket US API has two hosts: public market data at `https://gateway.polymarket.us` (no API key needed, e.g. `GET /v1/markets` and `GET /v1/markets/{slug}/book`) and authenticated trading at `https://api.polymarket.us`. This recipe gives you a prompt that has your AI coding tool build a read-only Python toolkit for markets, best bid/ask and order books, plus optional balance and position reads. It places no orders. - [Build a Polymarket Bot with Claude Code (Paper Mode + Guardrails)](https://botcookery.com/recipes/polymarket-bot-claude-code-paper-mode/): You can build a Polymarket US bot with Claude Code by having it write a bot that runs in paper mode by default: it simulates fills locally against the live public order book and can validate orders with `POST /v1/order/preview` without placing them. Polymarket US has no public demo exchange, so a local paper ledger, hard position limits, a kill switch and a locked live mode are the safe way to start. - [Kalshi API Starter: Markets, Order Books & Signed Requests in Python (2026)](https://botcookery.com/recipes/kalshi-api-starter/): The Kalshi Trade API v2 lives at `https://external-api.kalshi.com/trade-api/v2`, with a separate demo environment at `https://external-api.demo.kalshi.co/trade-api/v2`. Market data such as `GET /markets` and order books needs no key. Account calls need three headers and a signature over `timestamp + METHOD + path` (no query string), using RSA-PSS or Ed25519. This recipe builds that client against demo. - [Build a Kalshi AI Trading Bot (Demo First, With Hard Limits)](https://botcookery.com/recipes/kalshi-ai-trading-bot/): To build a Kalshi AI trading bot safely, have your AI coding tool write it against the Kalshi demo environment first, place orders with Create Order V2 (`POST /portfolio/events/orders`), cap exposure in code, and add order groups that auto-cancel resting orders when fills exceed a limit. An optional LLM research step only ever sees public market text, never your keys or balances. - [Claude Trading Bot: What Claude Can (and Can't) Do, Plus a Safe Starter](https://botcookery.com/recipes/claude-trading-bot/): Claude can't find you a winning strategy, but Claude Code is good at building a trading bot's plumbing: API clients from docs, the bot loop, tests and logging. The safe setup is a `CLAUDE.md` rules file, `permissions.deny` rules that block reading `.env` and key files, limits enforced in code, a kill switch, and Kalshi's demo environment before any real money. - [Polymarket & Kalshi Arbitrage Alert Monitor (Alerts Only): What's Real vs Hype](https://botcookery.com/recipes/polymarket-kalshi-arbitrage-alert-monitor/): A Polymarket–Kalshi arbitrage only exists if YES on one venue plus NO on the other costs less than $1.00 after fees, and both contracts settle on exactly the same outcome. Both conditions are rarer than bot sellers claim. This recipe builds an alerts-only monitor for market pairs you map by hand. It never places orders. - [Polymarket Telegram Alert Bot in One Prompt (Polymarket US, No Trading)](https://botcookery.com/recipes/polymarket-telegram-alert-bot/): A Polymarket Telegram alert bot is a small script that polls Polymarket US public prices (`GET https://gateway.polymarket.us/v1/markets/{slug}/bbo`, no API key) and sends you a Telegram message through the Bot API's `sendMessage` when a market crosses your level or moves fast. It needs no wallet and no trading access, and the bot token stays in an env var. - [Kill Switch & Position Limits for Kalshi and Polymarket US Bots](https://botcookery.com/recipes/trading-bot-kill-switch-position-limits/): A good kill switch for a prediction-market bot has three layers: a local `KILL` file the bot checks before every order, the venue's cancel-all endpoint (Kalshi `DELETE /portfolio/events/orders`, Polymarket US `POST /v1/orders/open/cancel`), and Kalshi order groups as a server-side safety net. Position limits belong in code and are checked before every order. - [Polymarket MCP Server: Read-Only Market Data in Claude, Cursor & More](https://botcookery.com/recipes/polymarket-mcp-server-read-only/): A read-only Polymarket MCP server is a small local process that gives Claude Code, Cursor or any MCP client four tools (search markets, get market, best bid/offer, order book) backed by Polymarket US public endpoints. It needs no API key and has no trading tools, so your AI tool can research markets without being able to place orders. - [ChatGPT Trading Bot: An Honest Guide + Kalshi Demo Starter (Codex)](https://botcookery.com/recipes/chatgpt-trading-bot-codex/): Yes, ChatGPT and Codex can build a trading bot, but they can't make it profitable, and they often remember outdated API endpoints. The safe way is to give the model the official Kalshi docs, put the BotCookery rules in `AGENTS.md`, run on Kalshi's demo exchange, keep keys in env vars, and enforce limits and a kill switch in code. - [Grok Trading Bot: Build a Kalshi Paper Bot with Grok (Spending Limits Included)](https://botcookery.com/recipes/grok-trading-bot/): You can use Grok to build a trading bot by having it scaffold a Kalshi bot that runs only on the demo exchange, with spending limits enforced in code (`limits.json` + `risk.py`) rather than in the prompt, a one-command kill switch, and an optional research step that only sees public market text. Grok writes the code; you set the rules. - [Kalshi & Polymarket US Weather Bot: Temperature Markets in Paper Mode](https://botcookery.com/recipes/prediction-market-weather-bot/): Kalshi and Polymarket US temperature markets settle on official sources: Polymarket US uses the NWS Daily Climate Report from the local forecast office, and each Kalshi market names its source in `rules_primary`. This recipe builds a paper-mode bot that pulls the free NWS API plus Kalshi's public weather index and logs what your rule would do, measured against the settlement source. - [Kalshi & Polymarket Bot Repos on GitHub: How to Audit One Before You Run It](https://botcookery.com/recipes/audit-kalshi-polymarket-bot-github-repo/): Before you run a Kalshi or Polymarket bot from GitHub, audit it with no secrets on the machine. Look for requests for private keys or seed phrases, obfuscated code, install scripts that run code, network calls to unknown domains and auto-updaters. Expect only official hosts like `external-api.kalshi.com` or `api.polymarket.us`. This recipe gives you an AI-assisted audit prompt and checklist. - [Claude Code Skills for Kalshi & Polymarket US Bot Builders (3 Copy-Paste Skills)](https://botcookery.com/recipes/claude-code-skills-trading-bots/): A Claude Code skill is a folder with a `SKILL.md` file: YAML frontmatter (a `description` that tells Claude when to use it) plus Markdown instructions. Project skills live in `.claude/skills//SKILL.md`, and you run one with `/name` or let Claude load it when relevant. For bot builders, skills are great for repeatable checks, but they're instructions, not enforcement: hard rules belong in hooks, deny rules and code. - [Claude Code vs Cursor (vs Codex & Grok Build) for Building Trading Bots: The Guardrails Compared](https://botcookery.com/recipes/claude-code-vs-cursor-codex-grok-trading-bots/): Any of the four can write a Kalshi or Polymarket US bot; none can make one profitable. The difference is guardrails. Claude Code is terminal-first with deep hooks and deny rules. Cursor is an AI code editor with rules, hooks and `.cursorignore` (which doesn't cover terminal or MCP tools). Codex starts with the strictest defaults: an OS sandbox with network off. Grok Build reads Claude and Cursor configs, but its sandbox is off by default. - [Claude Code Hooks for Trading Bots: Block Secrets, Gate Live Orders](https://botcookery.com/recipes/claude-code-hooks-trading-bots/): Claude Code hooks are scripts that run at fixed points in Claude Code's loop. For a trading bot, a `PreToolUse` hook can block the agent from reading `.env` or key files, starting the bot with `--live`, or running `git push`: the hook exits with code 2 and its stderr goes back to Claude. Pair hooks with `permissions.deny` rules, because hooks only govern the AI agent, not your running bot. ## Safety and platforms - [Safety Pack](https://botcookery.com/safety-pack/): rules file for CLAUDE.md / AGENTS.md / Cursor rules, .gitignore, Claude Code deny settings, pre-commit secret scanning and a position-limit module. - [Kalshi recipes](https://botcookery.com/platforms/kalshi/): CFTC-regulated US exchange for event contracts. Has a full demo environment with mock funds, so every Kalshi recipe starts there. - [Polymarket US recipes](https://botcookery.com/platforms/polymarket-us/): Polymarket US is the CFTC-regulated, USD-based exchange for US residents (separate from international Polymarket, which is close-only for the US). Public market data needs no key. ## Optional - [Full text of every recipe](https://botcookery.com/llms-full.txt): all recipes as plain Markdown in one file. - [About and disclaimer](https://botcookery.com/about/): who writes BotCookery, house rules and disclaimer. - [RSS feed](https://botcookery.com/rss.xml)