SDK for AI Agent Payments

Build agents that pay their own way.

AgentSDK is the TypeScript developer toolkit for integrating autonomous payment capabilities into AI agents. Register agents, manage wallets, enforce spending rules, and track every transaction — without building payment infrastructure from scratch.

your-agent.ts
import { SapiomAgent } from '@agentsdk/core';

const agent = new SapiomAgent({
  name: 'support-agent-01',
  wallet: { balance: 500, currency: 'USD' },
  policies: [
    { type: 'rate_limit', maxCalls: 120, per: 'minute' },
    { type: 'spend_cap', amount: 2000, per: 'day' },
  ],
});

agent.on('transaction', (tx) => {
  console.log(`${tx.service} — $${tx.amount}`);
});

// Agent is live and spending with full governance
AGENT wallet: active policies: 3 user requests admin config webhook events Twilio Sapiom API AWS Compute last transaction $0.042 — Twilio SMS
5 lines to a working agent
TypeScript first, Python soon
MIT open source
Sapiom native integration

From zero to paying agent in minutes.

1

Install the SDK

Add AgentSDK to your project with a single npm command.

npm install @agentsdk/core
2

Configure your agent

Define what your agent can spend, on which services, with what limits.

const agent = new SapiomAgent({ name: 'research-agent', maxDailySpend: 100, allowedServices: ['openai', 'twilio', 'aws'], });
3

Start building

Your agent now has a wallet, policy enforcement, and a full transaction log — built in.

agent.transact('openai', 0.003) .then(tx => console.log('done:', tx.id));

Everything your agents need to spend responsibly.

Agent Registry

Register agents with named identities, tied to your organization. Each agent gets a unique ID, a spending history, and a configurable policy set.

Agent.create({ name, orgId, policies })

Wallet Manager

Fund agent wallets, track balances in real time, and handle top-ups. Multi-currency support with automatic conversion. Balances update with every transaction.

wallet.balance // { USD: 342.12, EUR: 0 }

Policy Engine

Rate limits, spend caps, service allowlists, and custom rules. Policies are enforced server-side — agents cannot bypass them, even if compromised.

policies: [{ type: 'spend_cap', amount: 500 }]

Transaction Ledger

Every payment, refund, and authorization is recorded with full metadata. Query the ledger with filters: agent, service, time range, amount threshold.

ledger.query({ agentId, since: '24h' })

Service Catalog

Pre-built integrations with Twilio, AWS, OpenAI, and 40+ more services. Each service entry has pricing models, rate limits, and SDK helpers. Add your own in minutes.

catalog.use('twilio', { region: 'us-east-1' })

Webhooks and Events

Real-time event stream for every agent lifecycle event. Transaction confirmed, policy breached, wallet low, agent paused. Build your own automation layer on top.

agent.on('transaction', handlePayment)

Works with whatever you are already using.

OA

OpenAI Agents SDK

Plug AgentSDK into OpenAI's Agents SDK as a tool. One decorator, full payment capability.

Production ready
AC

Anthropic Agent SDK

Use AgentSDK as a client-side payment module. Full Claude Code integration.

Production ready
LC

LangChain and LangGraph

AgentSDK as a LangChain tool or custom LangGraph node. Works with LCEL chains.

Production ready
CR

CrewAI

CrewAI agent roles with AgentSDK payment capabilities baked in. Multi-agent orchestration.

Coming soon
MA

Mastra

TypeScript-native agent framework. AgentSDK ships as a first-class Mastra integration.

Coming soon

Don't see your framework? The SDK is framework-agnostic. Any agent that can call a function can pay with AgentSDK.

// Works with anything that supports tool calls const result = await agent.pay({ service: 'twilio', amount: 0.08, description: 'SMS notification', });

Built for developers who care about control.

01

Policy enforcement is server-side

Your agent code cannot bypass spending limits. Policies are enforced by the AgentSDK API, not by client-side checks. If the agent is compromised, it still cannot overspend.

02

Every transaction is auditable

The transaction ledger is append-only. Every payment, refund, and authorization creates an immutable record with full context: agent ID, service, amount, timestamp, and metadata.

03

Errors are not silent

A policy breach is an error, not a silent override. Failed transactions return structured errors with reason codes. Your agent code decides how to handle them.

04

Minimal dependencies, maximal clarity

The SDK has no heavy dependencies. The full package is under 50KB gzipped. You should understand every line of code your agent runs.

Built for the agentic economy

Agents that spend are agents that ship.

Every agent that needs to pay for a service — Twilio, OpenAI, AWS, a data API, anything — deserves a clean SDK that handles the complexity so you can focus on what the agent actually does.

// One SDK. Every service. Full control.
import { AgentSDK } from '@agentsdk/core';

const sdk = new AgentSDK({ apiKey: process.env.AGENTSDK_KEY });

// Give any agent a wallet and a policy
const agent = sdk.agent({ name: 'my-agent', budget: 1000 });

// It can now pay for anything it needs
await agent.pay('openai', 0.15, { description: 'gpt-4o completion' });
AGENT with wallet Twilio SMS OpenAI API AWS Compute Sapiom Payments