One Python decorator. Usage metering, signed receipts, reputation tracking. 100 calls free. 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. # 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.
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://neuralempireai.com/.well-known/agent.json https://neuralempireai.com/llms-full.txt # run the payment loop inside Claude / Cursor { "mcpServers": { "tollbooth": { "command": "tollbooth-mcp" } } }
After purchase, set TOLLBOOTH_LICENSE_KEY to activate Pro (see your receipt email for the key). Payment content is informational and not financial advice.