Stripe is the standard for charging people. nano-empire-tollbooth meters payments between code and autonomous agents. They solve different problems, and they can work together.
Most payment infrastructure assumes a human at checkout: a card number, a billing address, a subscription a person signs up for, and a chargeback window if something goes wrong. That model is mature and well served by Stripe. The machine economy looks different. An agent calls a function thousands of times an hour. There is no checkout page, no card, and no human to click confirm. What you need there is per-call metering, escrow, and an audit trail. That is the gap nano-empire-tollbooth fills.
| Dimension | Stripe | nano-empire-tollbooth |
|---|---|---|
| Primary payer | Humans at checkout | Code and AI agents |
| Unit of billing | Order, subscription, invoice | Single function or message call |
| Typical amount | Dollars to thousands | Fractions of a cent and up |
| Integration | SDK, hosted checkout, webhooks | One Python decorator |
| Failure handling | Refunds, disputes | Escrow refund on call failure |
| Budget control | Account level | Per-agent daily caps |
| Audit | Dashboard, reports | Append-only JSONL ledger |
| Test mode | Test keys | Paper mode, same code paths |
| Settlement | Card networks, bank | x402 hook, or your own backend |
This is informational and not financial advice.
The tollbooth does not replace a payment processor. It meters and escrows calls, then hands settlement to whatever you choose. You can wire Stripe as the settlement backend behind the tollbooth: the tollbooth counts and locks each call, and Stripe moves the actual money on a schedule. The x402 hook is optional and exists for crypto settlement. Without it, the tollbooth still locks escrow and writes the ledger, and you settle through Stripe, an invoice, or internal bookkeeping.
# Meter the call with the tollbooth from nano_empire_tollbooth import monetize @monetize(price_usd=0.01) def enrich(record: dict) -> dict: return run_pipeline(record) # Settle the accrued total elsewhere on your own schedule, # for example a monthly Stripe invoice built from the ledger.
If you sell to people, you need Stripe or an equivalent. If your code or your agents call functions that cost money to run and you want to attribute, cap, and recover that cost per call, you need a metering layer like the tollbooth. Many teams end up with both: Stripe at the human edge, the tollbooth at the machine edge.
Meter your first function in five minutes.
Read the quickstart