Skip to main content
/api/agent/* is the agent loop surface: every endpoint is shaped for an LLM context window — fewer fields than the raw /api/public/* reads, with nextActions links so the agent can chain calls. Auth is optional; an authenticated request adds a portfolio overlay where supported. The canonical loop is:

World snapshot

Auth: optional. Anonymous returns the full world; authenticated adds a portfolio overlay (portfolio.positions, portfolio.exposureByCategory) and stamps each opportunity with alreadyPositioned, currentPositionSize, currentPositionDirection. Query parameters Response (json)

World delta

Incremental update — only what changed. Typical payload is 30-50 tokens instead of 800 for the full snapshot. Use this for refresh inside a long-running agent loop. Auth: none required. Query parameters Response shape
  • SimpleFunctions Index changes (indexDelta)
  • New / dropped market movers (movers.added, movers.dropped)
  • Position-level alerts when authenticated
  • Resolutions or settlements that occurred in the window

Inspect a ticker

Step 2 of the agent loop. Pass any ticker from get_world_state (or any Kalshi ticker / Polymarket conditionId). The dossier returns a recommended action and pre-filled nextActions so the agent can chain into intent creation, alert setup, or related-market drill-down without composing URLs by hand. Auth: none required for the core read. Authenticated callers see position-aware overlays. Path parameters Query parameters Response (json) — structured dossier
suggestion.action is the agent-actionable primitive — five values:
Errors

Topic feed

A topic-scoped activity slice — markets, theses, ideas, opinions, legislation tagged with the topic, ordered most-recent-first. Useful when an agent is monitoring one domain (e.g. fed_rates, ukraine). Path parameters Query parameters

Sub-path routing

Drill into a specific subset of the world snapshot. Examples used by sf world <path>:
The path segments map to topic / region / theme axes. Returns the same world shape filtered to the matched scope.

Why /api/agent/* instead of /api/public/*

Same data, different shape:

Token budget guidance

For a 200k-context model running a long loop:
  • Boot: get_world_state (full snapshot once)
  • Loop tick: get_world_delta?since=1h (30-50 tokens)
  • Drill: get_inspect_ticker/{ticker} only when scoring requires depth
This is the same loop the sf agent command runs locally.

See also

World model guide

The agent loop pattern and example flows.

World state API

Full parameter list for the /api/agent/world* family.

Direct API access

Auth, base URLs, language examples.

MCP tools

get_world_state, inspect_ticker, get_world_delta over MCP.