SDK Overview
The Crumb SDK is a TypeScript toolkit for building with agentic payments. It provides everything you need on both sides of a paid API call.
Packages
| Package | Description |
|---|---|
crumb-alpha-core | Low-level primitives: wallet management, balance queries, settlement, error types |
crumb-alpha-sdk | High-level Crumb client for agents + createProvider for Express-based providers |
crumb-alpha-cli | Command-line tool for wallet management, deposits, withdrawals, and testing |
Quick Example
Agent (buyer):
import { Crumb } from 'crumb-alpha-sdk'
const crumb = new Crumb({
privateKey: process.env.TEST_PRIVATE_KEY!,
chain: 'arcTestnet',
})
const result = await crumb.fetch('https://api.example.com/search', {
method: 'POST',
body: { query: 'quantum computing' },
maxPayment: 0.01,
})
console.log(result.data) // API response
console.log(result.formattedAmount) // "0.001" (USDC paid)
console.log(result.txHash) // settlement transaction
Provider (seller):
import express from 'express'
import { createProvider } from 'crumb-alpha-sdk'
const app = express()
const provider = createProvider({
sellerAddress: '0x...',
})
app.post('/search', provider.require('$0.001'), (req, res) => {
res.json({ results: ['...'] })
})
Next steps
- Getting Started — install the SDK and run your first payment
- Demo Store — try a live paywalled API
- crumb-alpha-sdk reference — full API documentation