A
fetch()that pays. x402, L402, MPP — auto-detected, multi-chain, open source.
BoltzPay detects payment protocols, negotiates the best chain, pays, and returns data. One call. No vendor lock-in.
Docs · Registry · npm · GitHub
import { BoltzPay } from "@boltzpay/sdk";
const agent = new BoltzPay({
wallets: [
{ type: "coinbase", name: "main", coinbaseApiKeyId: "...", coinbaseApiKeySecret: "...", coinbaseWalletSecret: "..." },
],
budget: { daily: "5.00" },
});
const response = await agent.fetch(url);
// x402, L402, MPP — protocol auto-detected, payment handledBrowse 6,900+ scored endpoints from the BoltzPay Registry:
const apis = await agent.discover({ protocol: "mpp", minScore: 80 });| Protocol | Payment | Wallet |
|---|---|---|
| x402 | USDC on-chain (Base, Solana) | Coinbase CDP |
| L402 | Bitcoin Lightning | NWC |
| MPP | Stripe, Tempo, Visa | Multi-wallet |
The SDK auto-detects which protocol an endpoint uses. Configure one or more wallets — the router tries each until one succeeds.
MPP streaming sessions with deposit, pay-per-chunk, and clean close:
const session = await agent.openSession(url);
const res = await session.fetch(url);
const receipt = await session.close(); // { totalSpent, refunded, voucherCount }Wrap any MCP client with automatic payment handling (-32042):
const wrapped = await agent.wrapMcpClient(mcpClient);
const result = await wrapped.callTool({ name: "paid-tool" });
// Budget enforced, receipt returnedOr give Claude Desktop a payment wallet — zero code:
{
"mcpServers": {
"boltzpay": {
"command": "npx",
"args": ["-y", "@boltzpay/mcp"]
}
}
}agent.on("budget:exceeded", (e) => console.log(`Blocked: ${e.period}`));
agent.on("payment", (e) => console.log(`${e.amount.toDisplayString()} via ${e.protocol}`));
const budget = agent.getBudget();
// { dailySpent, monthlySpent, dailyLimit, monthlyLimit,
// perTransactionLimit, dailyRemaining, monthlyRemaining }Daily, monthly, per-transaction limits. Session deposit reservations. Allowlist/blocklist. Max amount guard.
npx @boltzpay/cli discover --protocol mpp --min-score 70
npx @boltzpay/cli fetch https://api.example.com
npx @boltzpay/cli diagnose https://api.example.com
npx @boltzpay/cli quote https://api.example.com| Package | Description |
|---|---|
| @boltzpay/sdk | SDK — fetch, discover, sessions, budget, events |
| @boltzpay/core | Domain types, Money VO, protocol interfaces |
| @boltzpay/protocols | Protocol adapters (x402, L402, MPP) |
| @boltzpay/mcp | MCP server — 7 tools for Claude Desktop |
| @boltzpay/cli | CLI — terminal + Python bridge |
| @boltzpay/ai-sdk | Vercel AI SDK tools |
- LangChain:
pip install langchain-boltzpay— docs - CrewAI:
pip install boltzpay-crewai— docs - n8n:
@boltzpay/n8n-nodes-boltzpay— docs - OpenClaw: see
integrations/openclaw/
See CONTRIBUTING.md for setup instructions and PR guidelines.
MIT — see LICENSE
Created by @leventilo