Quickstart
From zero to your first phrase_detected event in under five minutes.
1. Get a token
Sign in at langbot.ai/app/tokens and create an API token. It is shown once; it looks like lb_…. The same token works everywhere: send it as Authorization: Bearer lb_… to REST at https://api.langbot.ai, to the WebSocket at wss://api.langbot.ai/v1/stream and to the hosted MCP server at https://mcp.langbot.ai/mcp. The SDKs and the CLI read it from LANGBOT_API_TOKEN.
export LANGBOT_API_TOKEN=lb_...2. Install
# everything: token, Kalshi key setup, MCP install into Claude Code / Cursor / Claude Desktopnpx langbot init --token lb_... # or just the pieces you wantpip install langbot-sdk # Python SDK + `langbot run` agent runtimenpm i @langbot/sdk # TypeScript SDKuvx langbot-mcp # MCP server over stdio3. Watch an event
langbot events # live + upcoming events with marketslangbot watch <event_id> --phrases buyback,tariff # an id from the list aboveEach line is a JSON event. This is one as Langbot recorded it: JPMorgan Chase's Q3 2026 earnings call on 13 October 2026, "buyback" on the public webcast at 08:46:04.415 ET, detected 78 ms after the word ended. Hits from 31 October on also carry a verdict.
{ "type": "phrase_detected", "phrase": "buyback", "market_refs": ["KXEARNINGSMENTIONJPM-26OCT13-BUYB"], "t_spoken": 1791895564415, "t_detected": 1791895564493, "confidence": 0.6, "source_kind": "hls"}The fields that matter:
| field | meaning |
|---|---|
t_spoken | ms epoch, when the word ended |
t_detected | ms epoch, when Langbot detected the phrase |
t_emitted | ms epoch, when Langbot sent it to you |
lag_vs_public_ms | measured lead vs the public webcast, when known |
market_refs | venue tickers whose rules match the phrase |
verdict | whether the hit counts under the market's rules: counts, reason, role, mention of needed |
source_kind | sip, hls, webrtc, ota or file |
hash, prev_hash, chain_seq | the event's receipt: a hash chained per source, signed in checkpoints |
Prove it: langbot receipt evt_01K7… recomputes the hash and shows the signed checkpoint that covers it, or paste the event at langbot.ai/verify. See Receipts.
4. Write a strategy
from langbot import Strategy, Event class Mention(Strategy): markets = ["KXEARNINGSMENTIONNVDA-*"] phrases = ["blackwell"] async def on_event(self, evt: Event): if evt.type == "phrase_detected" and evt.phrase == "blackwell": await self.buy_yes(evt.market_refs[0], price=58, count=10)langbot run strategy.py --mode demo # paper on demo.kalshi.co — always start herelangbot run strategy.py --mode live # your keys, your account, your risk railsRisk rails are enforced in-process from env: LANGBOT_MAX_POSITION_USD, LANGBOT_MAX_DAILY_LOSS_USD, LANGBOT_MARKET_ALLOWLIST.
5. Or skip the code: use MCP
Add the hosted server with your token, then ask your assistant what is on the line:
claude mcp add --transport http langbot https://mcp.langbot.ai/mcp \ --header "Authorization: Bearer lb_..."which markets settle on tonight's debate, and has anything counted yet?
The server answers from the same record as the API: the calendar, the markets and their rules, and each hit with its verdict. Strategies it drafts are files you review and run yourself. See MCP.
What Langbot is not
Langbot delivers data ("the word tariff was spoken at t"), not buy or sell signals. Execution happens on your machine with your keys. Pricing is flat. Read the risk disclosure.