One Python decorator. Usage metering, signed receipts, reputation tracking. Unlimited paper-mode calls. No credit card.
# 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. # Paper mode is free and unlimited — a one-time nag after 100 calls. No card.
New to the idea? Start with monetize a Python function in 10 lines or read why AI agents need payment rails.
Attribute cost to a single function call instead of one flat infrastructure bill.
Lock on call, release on success, refund on failure. Failed work does not accrue cost.
A runaway agent hits its ceiling in hours, not at the end of the month.
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.
Same decorator everywhere. Pick your framework, copy, paste, charge.
from nano_empire_tollbooth import monetize @app.post("/summarize") @monetize(price_usd=0.01) async def summarize(req: Request): return run(await req.json())
from nano_empire_tollbooth import monetize @mcp.tool() @monetize(price_usd=0.05) def search_docs(query: str) -> str: return index.search(query)
from nano_empire_tollbooth import monetize @tool @monetize(price_usd=0.02) def get_signal(ticker: str) -> str: """Market signal for a ticker.""" return fetch_signal(ticker)
from nano_empire_tollbooth import monetize, get_usage @monetize(price_usd=0.01) def translate(text: str, lang: str) -> str: return llm(text, lang) print(get_usage())
Humans get the tour. Machines get a door. Every entrance below is live.
# experience a real x402 challenge curl -X POST https://api.nanoempireai.com/x402/summarize # one-fetch storefront + full API for your context window https://nanoempireai.com/.well-known/agent.json https://nanoempireai.com/llms-full.txt # run the payment loop inside Claude / Cursor { "mcpServers": { "tollbooth": { "command": "tollbooth-mcp" } } }
The audit is a manual review delivered as a written findings packet. Paper mode is the default and the SDK never holds funds. Informational, not financial advice.