Install
Initialize
pk_test_* → sandbox, pk_live_* → production.
Resource clients
Every resource has its own client:Protocol clients
Auto-retries
By default, network errors and 5xx responses retry with exponential backoff (3 attempts, 100ms → 400ms → 1600ms). Idempotent operations (GET, DELETE, plus POSTs withidempotency_key) are safe to retry. Non-idempotent POSTs retry only on network errors, never on 5xx.
Tune:
Idempotency
Always set an idempotency key on writes you care about:Error handling
The SDK throws typed errors:code— machine-readable error codemessage— human-readablestatus— HTTP statusdetails— contextual info (amount, limits, offending field)requestId— for support tickets
Pagination
List endpoints return a page + continuation:Persistent SSE
Open a push channel (requires agent auth):Last-Event-ID replay, and session refresh.
LangChain integration
The SDK exports LangChain-compatible tools:Webhook verification
Typescript types
All request + response shapes are exported:Further reading
- Full method index: API reference
- CLI (built on the same SDK):
@sly_ai/cli - MCP server (also built on the SDK):
@sly_ai/mcp-server
