nano-empire-tollbooth · live on PyPI

Monetize any Python function with one decorator

Add one line to a function and every call is metered, logged, and settled. Start free with 100 calls in paper mode. Switch to live payments when you are ready.

$ pip install nano-empire-tollbooth 5-minute quickstart

Three lines, then you are metering

# pip install nano-empire-tollbooth
from nano_empire_tollbooth import monetize

@monetize(price_usd=0.01)
def summarize(text: str) -> str:
    return my_llm(text)

# Every call is metered, logged to a JSONL ledger, and settled.
# First 100 calls run free in paper mode. No card required.

New to the idea? Start with monetize a Python function in 10 lines or read why AI agents need payment rails.

Why teams use it

Per-call accounting

Attribute cost to a single function call instead of one flat infrastructure bill.

Escrow lifecycle

Lock on call, release on success, refund on failure. Failed work does not accrue cost.

Per-agent daily caps

A runaway agent hits its ceiling in hours, not at the end of the month.

Append-only ledger

Every charge is one JSON line with timestamps and status. Auditable by default.

Building agents or tools? See agent-to-agent payments, MCP server monetization, and the x402 protocol explained.

Free and Pro

Free · paper mode
$0
  • 100 metered calls
  • Full local JSONL ledger
  • Escrow simulation
  • Per-agent caps
Start free

Pricing reflects the package README. Payment and crypto content is informational and is not financial advice.