API Reference
Programmatic access to Discovery, Signal, Quote, and research.
Authentication
Create an API token in Settingsand pass it as a bearer token. Quote persistence and other mutations require an appropriately scoped token.
curl -H "Authorization: Bearer <api-token>" \
https://hedgelayer.ai/api/profileAvailable endpoints
| Category | Endpoint | Method | Description |
|---|---|---|---|
| Discovery | /api/search | POST | Canonical topic search across explicit venues |
| Discovery | /api/feed | GET | Deterministic Polymarket feed screens |
| Discovery | /api/feed/discover | POST | Bounded Polymarket Feed discovery, JSON or SSE |
| Signal | /api/signal/analyze | POST | Signal analysis, JSON or SSE |
| Signal | /api/signal/recent | GET | Recent complete user-scoped forecasts |
| Quote | /api/quote | POST | Generate an ephemeral or saved Polymarket preview |
| Quote | /api/quote | GET | List owned saved previews |
| Quote | /api/quote/:id | DELETE | Delete an owned saved preview |
| Research | /api/chat | POST | Streaming conversational research |
| Research | /api/brief | POST | Generate a Market Brief |
| Research | /api/assessments | GET, POST | List/create research sessions |
| Research | /api/assessments/:id | GET, PATCH, DELETE | Read/update/delete a session |
| Markets | /api/orderbook | GET | Public Polymarket order-book helper |
| Markets | /api/bookmarks | GET, POST | List/save venue-aware bookmarks |
| Markets | /api/bookmarks/:marketId | DELETE | Delete a bookmark |
| MCP | /mcp | POST | Authenticated stateless market-search tools |
| Account | /api/profile | GET, PATCH | Read/update profile |
| Account | /api/tokens | GET, POST | List/create API tokens |
| Account | /api/tokens/:id | DELETE | Revoke an API token |
Discovery
POST /api/search accepts a query and explicit non-empty venues array containing polymarket, kalshi, or both. Canonical instruments preserve venue-native identity, rules, payoff, timing, units, fees, and capabilities.
curl -X POST https://hedgelayer.ai/api/search \
-H "Authorization: Bearer <api-token>" \
-H "Content-Type: application/json" \
-d '{"query":"UK interest rates","venues":["polymarket","kalshi"]}'POST /api/feed/discover accepts global or topic discovery and can stream safe operational progress over SSE. Feed is Polymarket-only and returns candidate IDs for later analysis. An optional portfolio_context can provide up to 100 safe held-market summaries. Exact held slugs and events are removed before curation; related topics remain eligible under an exposure-aware per-topic cap.
Model Context Protocol
POST /mcp uses the same bearer tokens as the general API and requires read scope. The stateless Hedge Layer MCP server exposes search_markets with venue-labelled output. Its thin provider adapters search Polymarket prediction markets and Hyperliquid perpetual and spot markets without adding an agent loop or trading authority.
Venue decimals remain exact strings and carry explicit units. Funding includes its interval, open interest identifies its contract unit, and every result carries source and retrieval metadata. Missing or invalid venue numbers are omitted instead of being converted to zero.
Agent H users can create a token in Settings and run agent-h mcp configure --token <api-token>.
Signal
POST /api/signal/analyze accepts Polymarket URL input or structured Polymarket/Kalshi market input. It returns a forecast and interval or abstains. Signal never sizes or executes.
curl -X POST https://hedgelayer.ai/api/signal/analyze \
-H "Authorization: Bearer <api-token>" \
-H "Content-Type: application/json" \
-d '{"url":"https://polymarket.com/event/example-market"}'JSON and SSE modes preserve lifecycle aliases and market_slugfor existing clients. The SSE terminal frame is a finalevent containing the result. GET /api/signal/recent returns the newest valid complete forecast per requested slug/window.
Quote
POST /api/quote supports Polymarket only. It accepts an instrument, action/outcome, exactly one size mode, optional Signal or manual-capital context, route and risk limits, and persist.
curl -X POST https://hedgelayer.ai/api/quote \
-H "Authorization: Bearer <api-token>" \
-H "Content-Type: application/json" \
-d '{
"instrument":"example-market",
"action":"BUY",
"outcome":"YES",
"size":{"type":"cash","amount_usd":25},
"route":"auto",
"persist":false
}'Response status is READY, PARTIAL, PASSIVE_ONLY, SKIP, or UNAVAILABLE. The response includes instrument, request, market/book, fill, economics, optional Signal and sizing suggestion, risks, observation/expiry timestamps, and execution.supported: false.
persist: true refreshes public data before saving. Saved rows never retain manually entered portfolio capital, balances, credentials, signatures, or executable headers.
No execution APIs
v3 exposes no wallet, deposit, withdrawal, trading-credential, order, strategy-management, execution, or P&L endpoints. Obsolete paths are removed rather than supported through compatibility handlers.