for agent builders
Give your agent a budget instead of a hundred vendor accounts: a drop-in paying client calls any paid tool, settles per call over Lightning, and stops at the cap you set. No signups, no API keys, no card on file.
import { PayingClient, l402Payer } from "@bolthub/pay";
const client = new PayingClient({ payers: [l402Payer({ wallet })], // pays Lightning invoices maxTotal: { sat: 10_000 }, // budget ceiling});
// callTool handles challenge -> pay -> retry transparently:const result = await client.callTool(mcpClient, "get_satellite_image", { lat, lon });The subscribe-and-manage-API-keys model assumes a human at a dashboard. An autonomous agent needs to discover a tool, pay for it, and use it — at runtime, programmatically, within a budget you set. bolthub Pay makes the payment itself the credential, so a single client reaches every paid tool that speaks the profile.
One client answers a tool's Lightning invoice and retries with the proof of payment. Any paid tool your agent reaches settles the same way, straight to the provider.
A per-asset cap bounds spend. The agent pays per call within it and stops at the limit. No surprise bills, no standing authorization.
The paid proof is the credential. Nothing to provision, store, or rotate. The agent discovers a tool, pays, and uses it at runtime.
Add your wallet, set a budget, and the client handles the rest: challenge, payment, and retry are transparent to your agent code.
bun add @bolthub/payThe budget is a hard cap on the client: “spend at most 10,000 sats, total.” Every payment is counted against it before it happens, and the client refuses any offer that would cross the line. Delegating to a sub-agent? Mint it a scoped, capped, expiring credential from what you already hold; the cap is reserved from your budget at mint time, the gateway enforces it, and you can revoke the whole tree in one call. The worker never holds your keys or an open-ended balance.
Paying per call is the start. These make L402 feel built for autonomous work, not retrofitted for it. All opt-in; none of them change a normal single-payment call.
Pay once for a sats budget and spend it across all of a provider's endpoints, with no Lightning round-trip per call. Face-value, non-custodial: one payment settles to one provider, so it never becomes a pooled balance.
Mint a capped, expiring child credential and hand it to a sub-agent. Tighten-only, enforced server-side, and revocable in one call. The worker holds a slice, never your wallet.
If the origin is unreachable or returns 5xx/429/408, your paid proof stays spendable, so re-sending the identical request is free. The SDK does it automatically. Nothing is clawed back over Lightning; if the origin gave you nothing, the attempt simply costs nothing.
Every paid call produces a receipt from the Lightning preimage. Keep a local ledger, export it as JSON or CSV, and verify each entry offline. Redact the preimage for shareable reports.
Curious how Lightning settlement compares to on-chain rails? Read L402 vs x402 for why bolthub is Lightning-only.
start calling
Wire bolthub into Cursor, Claude Desktop, or your own orchestrator. Add your wallet, set a budget, and your agent can discover and call any listed tool. Building in code? Python and TypeScript SDKs call any hub API directly.