sf.
Prefer the CLI when a local agent wants tool discovery, local config, command policy tags, or sf describe --all --json as its control plane. Use MCP only as the final adapter when the host requires Model Context Protocol.
Base URLs
| Surface | URL |
|---|---|
| Core API | https://simplefunctions.dev |
| Data REST | https://data.simplefunctions.dev/v1 |
| Data WebSocket | wss://app.simplefunctions.dev/ws |
wss://data.simplefunctions.dev/v1/ws as the public WebSocket URL unless the real-time data page says it has moved.
Auth matrix
| Surface | Auth | Notes |
|---|---|---|
/api/public/* | Usually no auth for public reads | Auth may unlock higher limits, higher model tiers, or user overlays on supported routes. |
/api/agent/world, /api/agent/inspect/* | No auth for core reads | Compact payloads for agents. |
/api/contracts/tools | No auth | Strict SDK/Agent contract manifest. |
/api/tools | No auth | Broad hosted compatibility inventory. |
/api/thesis/*, /api/feed, /api/intents, /api/keys | Authorization: Bearer sf_live_... | User-owned data. |
/api/portfolio/* | Authorization: Bearer sf_live_... | User-scoped portfolio memory and config. |
/api/watch, /api/alert-rules, /api/webhook-endpoints | Authorization: Bearer sf_live_... | User-owned workflow state. |
data.simplefunctions.dev/v1 | See Real-time data | Data API auth is documented separately. |
First curl calls
Public reads:TypeScript
Python
Responses and errors
Public endpoints generally return endpoint-specific JSON directly. Account, portfolio, and workflow endpoints often use{ ok, ... } envelopes where documented. Always branch on HTTP status first. Do not scrape prose from rendered docs or terminal output. Prefer format=json where a route supports it.
Endpoint chooser
| Need | Endpoint |
|---|---|
| Find markets for a natural-language event | GET /api/public/query?q= |
| Get compact world context | GET /api/agent/world?format=json |
| Get changes since last loop | GET /api/agent/world/delta?since=1h&format=json |
| Inspect one ticker | GET /api/agent/inspect/{ticker} |
| Get one market detail | GET /api/public/market/{ticker} |
| Search official econ context | GET /api/public/query-econ?q= |
| Search gov or legislative context | GET /api/public/query-gov?q= |
| Discover canonical SDK/Agent tools | GET /api/contracts/tools |
| Discover broad hosted compatibility tools | GET /api/tools |
| Read user portfolio memory | GET /api/portfolio/state, /ticks, /trades |
| Create user workflow notifications | /api/watch, /api/alert-rules, /api/webhook-endpoints |
SDK and Agent contract note
If you are building against the TypeScript SDK or Agent SDK packages, use/api/contracts/tools for canonical tools. /api/tools remains a broad hosted
inventory for compatibility and remote HTTP discovery.
Safety notes
API keys are secrets. Do not paste them into prompts, public logs, or client-side bundles. Execution endpoints can mutate real account state. Prediction markets are probabilities, not guarantees. User-owned endpoints are scoped to the authenticated user; do not passuserId for normal reads.