Routeweiler¶
The financial operating system for AI agent fleets.
A single line — await routeweiler.get(url) — that pays across any rail,
enforces spend caps, audits every transaction, and governs every agent that touches money.
import asyncio
from eth_account import Account
from routeweiler import Routeweiler, Funding
async def main():
signer = Account.from_key("0xYOUR_PRIVATE_KEY")
async with Routeweiler(funding=[Funding.base_usdc(wallet=signer)]) as client:
response = await client.get("https://api.example.com/data") # 402 handled silently
print(response.json())
asyncio.run(main())
Get started in 5 minutes GitHub
What Routeweiler does¶
When a server returns 402 Payment Required, Routeweiler:
- Intercepts 402 and parse the challenge — x402, L402, MPP-Tempo, or MPP-SPT.
- Enforces policy rules for URL patterns, rail, or amount.
- Routes to the best rail using cost, policy, and sticky-session preferences.
- Enforces budgets for agent or session with Ed25519-signed draw receipts.
- Pay and retry with signed Authorization header.
- Emits a trace for each call as one structured SQLite event.
Supported rails¶
| Rail | Protocol | Settlement |
|---|---|---|
| x402 | EVM signed transfer | On-chain USDC (Base, etc.) |
| L402 | BOLT-11 Lightning | Sats |
| MPP-Tempo | Tempo 0x76 transaction | PathUSD / USDC |
| MPP-SPT | Stripe Shared Payment Token | Fiat card |
Non-custodial by design¶
Keys stay in the caller's process. Routeweiler never holds funds, never proxies payments through a server, and never transmits private keys. This keeps it outside money-transmitter and CASP regulations. See the FAQ for details.