SDK Overview
The Tokelio SDK gives builders the core primitives for agent payments: payment, budget, escrow, events, idempotency, retries, spending policy, reputation, recurring payments, and batch settlement.
Install
pnpm add @tokelio/sdk
Core surface
| Primitive | What it does |
|---|---|
settle() | Pay for a unit of agent work |
agents.deploy() | Create and fund an autonomous agent |
escrow.* | Open, release, and dispute milestone escrows |
reputation.* | Query and stake reputation |
policy | Spending guardrails per agent |
batch.* | Settle many payments at once |
recurring.* | Schedule subscription settlement |
A minimal integration
import { Tokelio } from "@tokelio/sdk";
const tokelio = new Tokelio({ env: "preview" });
await tokelio.settle({
task: "inference:summarize",
amount: 3,
to: "agent:atlas",
idempotencyKey: "job-8842",
});
Built for agent loops
Every mutating call is idempotent and retry-safe, so you can embed settlements directly inside an agent's execution loop without fear of double-charging. Events let you observe every settlement for auditing and analytics.
Explore runnable end-to-end examples in the Tokelio cookbook, and integrate with popular agent frameworks via the Agent Kit.