bolthub
PricingBlogDocs
bolthub

Rail-agnostic pay-per-call for MCP tools and APIs. Agents pay per call and you keep custody. Lightning today, more rails next. Built for tool builders and AI teams.

contact@bolthub.ai

Product

All productsbolthub Pay SDKHosted platformToolClientAPI HubNode LauncherPricingFor tool buildersFor agentsCharge for your toolsDocs

Legal

Terms of ServicePrivacy PolicySecurityAcceptable Use

Resources

API HubBlogWhat is L402?L402 vs x402RSS feed

Packages

npm

@bolthub/​payTool-payment SDK@bolthub/​agentL402 payment client@bolthub/​cliCLI@bolthub/​mcp-registryRegistry MCP@bolthub/​mcp-bridgeBridge MCP@bolthub/​verifyWebhook verifier

PyPI

bolthubPython SDKbolthub-verifyPython verifier
bolthub

© 2026 Signal Tech Pty Ltd. All rights reserved.

products / pay-sdk

Open source · MIT · Free

Put a price on any tool in a few lines.

The open-source payment layer for tools: price any MCP tool or HTTP endpoint, and give your agent a hard budget to buy with. Self-hosts with no account, settles straight to your wallet, and you keep 100% of what you charge.

Read the 60-second guidenpm: @bolthub/pay
server.ts
import { createPaywall, l402Rail } from "@bolthub/pay";
// A rail needs a signing secret and something that makes invoices —
// your wallet (NWC / LND / phoenixd / LNbits) or a bolthub facilitator.
const pay = createPaywall({
rails: [l402Rail({ secret: process.env.PAY_SECRET!, invoiceProvider })],
});
// Charge 2000 sats for one MCP tool call:
pay.tool(server, "get_satellite_image", "Recent satellite imagery", schema,
{ price: { amount: 2000 } },
async (args) => ({ content: [{ type: "text", text: await fetchImage(args) }] }),
);

Both sides, one package

Sell with paywall() and rails; buy with ToolClient and payers. The challenge one side emits is exactly what the other side answers.

Zero runtime dependencies

Nothing between your agent and its tools but code you can read. Wallets and heavier adapters live in isolated subpaths you opt into.

Rails are pluggable

Lightning (L402) is live today; x402 stablecoin adapters ship in the package. Price a tool once and swap or add rails without touching the handler.

One loop: challenge, pay, prove.

A paid tool answers an unpaid call with a payment_required challenge listing the rails it accepts. The buyer pays one offer, retries with the proof, and the tool runs. Money moves buyer to seller on the rail itself; the SDK only orchestrates the loop, so there is no middleman to trust with funds.

Sell: wrap a tool, name a price.

Works with any MCP server or HTTP handler you already have. Want managed metering, replay protection, and analytics behind the same code? Point the rail at the hosted facilitator later; the handler doesn’t change.

terminal
bun add @bolthub/pay

Buy: give your agent a budget, not a card.

The buyer side is ToolClient: per-asset spending ceilings enforced before any payment leaves, free tools passed through untouched.

client.ts
import { ToolClient, l402Payer } from "@bolthub/pay";
// Hard ceilings, per asset. Zero configured = the agent can't spend at all.
const client = new ToolClient({
payers: [l402Payer({ wallet })],
maxTotal: { sat: 10_000 },
maxPerCall: { sat: 500 },
});
// Free tools pass through untouched; paid ones are paid and retried.
const result = await client.callTool(mcp, "get_satellite_image", {
lat: 47.4979,
lon: 19.0402,
});

Real-world use

An MCP server that earns while you sleep

You maintain an MCP server with one expensive tool, say satellite imagery that costs you real money per fetch. Wrap that one tool at 2,000 sats, leave the rest free, and publish the server as usual. Agents with a budget call it and pay per use; agents without one get a clean challenge instead of a bill you have to chase. No API keys to issue, no subscriptions to support, no card processor that won’t touch sub-cent amounts.

Where to go deeper

  • SDK quickstartSeller and buyer setup, end to end, in about a minute.
  • Hosted facilitator guideBack the same code with managed metering and analytics.
  • L402 vs x402How the two rails differ, and why you don't have to choose.

start selling

Start earning from your tools today

Self-host the SDK free, or start on the hosted platform: 1-month free trial, usage-based billing after that.

Start your free trialStart free with the SDK

hub / btc-intel

  • GET /v1/derivatives/cme-basis3 sats/req
  • GET /v1/market/multi_exchange3 sats/req

LIVE32 endpoints · btc-intel.gw.bolthub.ai

browse the hub →