Skip to main content
Use @spfunctions/sdk when a TypeScript service, notebook, dashboard, or agent harness owns the application code.

1. Install

Use Node 18 or newer. Use the stable package version.

2. Create the client

Do not expose long-lived API keys in browser bundles.

3. Inspect the manifest without a key

The SDK uses canonical dotted names from /api/contracts/tools.

4. Read market context

5. Read portfolio and runtime state

6. Guard execution explicitly

execution.place supports Kalshi and Polymarket through the runtime-backed intent path. It checks runtime candidates and starts or wakes a usable runtime when allowed before creating the intent. Polymarket orders require a CLOB token id and explicit limit price. Use small limits, explicit rationale, and your own application-level guardrails.

Next steps

SDK

Full SDK surface.

SDK market research cookbook

Build a read-only research loop.

Execution guardrails cookbook

Runtime and order safety pattern.

Agent SDK quickstart

Add a model loop and policy hooks.