Skip to main content
KeyStone provides official SDKs for TypeScript and Python. Both handle authentication, retries, idempotency, and webhook verification out of the box - so you can focus on your settlement logic.

Available SDKs

TypeScript / Node.js

@keystoneos/sdk - for Node.js 18+ backends and serverless functions.

Python

keystoneos - async and sync clients for Python 3.10+.

What the SDKs handle

FeatureDetails
AuthenticationAuth0 M2M token fetch, caching, and automatic refresh before expiry
RetriesExponential backoff with jitter on 429 and 5xx responses. Respects Retry-After headers
IdempotencyBuilt-in generateIdempotencyKey() helper for safe retries on settlement and instruction creation
Webhook verificationHMAC-SHA256 signature verification with timing-safe comparison
Type safetyFull TypeScript types / Pydantic models for all request and response objects
PaginationAll list endpoints return typed paginated responses with items, total, limit, offset

When to use an SDK vs raw HTTP

Use an SDK when you are building a backend integration in TypeScript or Python. The SDKs eliminate boilerplate around authentication, error handling, and retries. Use raw HTTP (cURL, httpx, fetch) when:
  • Your platform uses a language we don’t have an SDK for yet
  • You need fine-grained control over HTTP behavior
  • You are prototyping in a notebook or script
Every endpoint shown in the API Reference works with any HTTP client. The SDKs are convenience wrappers, not a separate API.

Quick comparison

import { KeystoneClient } from "@keystoneos/sdk";

const client = new KeystoneClient({
  clientId: process.env.KEYSTONE_CLIENT_ID!,
  clientSecret: process.env.KEYSTONE_CLIENT_SECRET!,
});

const instruction = await client.instructions.submit({
  templateSlug: "cross_platform_dvp",
  role: "seller",
  party: {
    externalReference: "SELLER-001",
    walletAddress: "0x1234...abcd",
    chainId: 11155111,
  },
  legs: [{ instrumentId: "BOND-A", quantity: "1000000", direction: "deliver" }],
  timeoutAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
  idempotencyKey: client.generateIdempotencyKey(),
});