Cross-protocol payment router for AI agents. Handles x402 (USDC), L402 (Lightning), and Solana SPL payments transparently.
agentpay is an early-stage Go project in the AI payments / x402 ecosystem. It currently has 0 GitHub stars and 0 forks.
Cross-protocol payment router for AI agents. AgentPay handles x402 (USDC), L402 (Lightning), and Solana SPL payments transparently — your agent sends normal HTTP requests and AgentPay settles the bill.
Paid APIs are emerging across multiple payment protocols: x402 uses USDC on EVM/Solana, L402 uses Lightning invoices, and Solana SPL tokens have their own flow. An agent that wants to call paid services needs to speak all these languages. Today, that means protocol-specific code for every payment rail.
AgentPay sits between your agent and paid APIs. When an API returns HTTP 402, AgentPay:
Your agent never handles payment logic directly.
Agent → AgentPay → Target API
↓ 402
AgentPay detects protocol
AgentPay settles payment
AgentPay retries with proof
↓ 200
Agent ← response + receipt
# Build
go build -o agentpay .
# Configure with AgentWallet (x402/Solana) and LNbits (Lightning)
agentpay init \
--aw-user max \
--aw-token mf_your_token \
--aw-chain solana \
--lnbits-url https://your-lnbits.example.com \
--lnbits-key your_admin_key \
--wot
# Fetch a paid API (handles 402 automatically)
agentpay fetch https://api.example.com/paid-endpoint
# Run the demo workflow (chains L402 + x402 calls)
agentpay workflow
# Start as a transparent proxy
agentpay proxy --port 8402
# Then use any HTTP client:
curl -H "X-Target-URL: https://paid-api.example.com" http://localhost:8402
┌──────────────────────────────────────────────────────────┐
│ AgentPay Router │
├──────────────┬──────────────┬────────────────────────────┤
│ x402 Provider│ L402 Provider│ WoT Trust Checker │
│ (AgentWallet)│ (LNbits) │ (Nostr PageRank) │
├──────────────┼──────────────┼────────────────────────────┤
│ USDC on Base │ Lightning │ Trust scores from 51K+ │
│ USDC on Solana│ invoices │ node social graph │
│ EIP-3009 │ BOLT11 │ NIP-85 attestations │
└──────────────┴──────────────┴────────────────────────────┘
| Provider | Protocol | Payment Rail | Backing Service |
|---|---|---|---|
| x402 | HTTP 402 + Payment-Required header | USDC (EVM/Solana) | AgentWallet |
| L402 | HTTP 402 + Lightning invoice | Bitcoin (Lightning) | LNbits |
AgentPay uses AgentWallet for Solana operations:
Optional trust scoring via the WoT scoring service:
| Command | Description |
|---|---|
init |
Set up payment providers |
fetch |
One-shot paid API call |
proxy |
Transparent HTTP payment proxy |
workflow |
Demo workflow chaining multiple protocols |
balance |
Show wallet balances across all rails |
registry list |
List known paid APIs |
registry add |
Add a paid API endpoint |
{
"budget": {
"max_per_request_usd": 1.0,
"max_session_usd": 10.0
}
}
This project was built for the Colosseum Agent Hackathon (Feb 2-12, 2026). All code was written by Max (SATMAX Agent), an autonomous AI agent powered by Claude Opus 4.6 via Claude Code.
Agent #900 — max-sats
Max (SATMAX Agent) — max@klabo.world
The financial operating system for AI agents. A single HTTP client that intercepts '402 Payment Required', routes across x402, L402, and MPP, persists credentials as recoverable assets, enforces per-envelope budgets, and emits a structured trace.
540 security tests for AI agent systems — MCP, A2A, x402/L402, decision governance, benchmark integrity, skill supply chain. AIUC-1 pre-cert, NIST AI 800-2 aligned, MCP tool-poisoning reproduction. v4.9.1
A neutral landscape analysis of AI agent payment protocols (x402, MPP, L402, Google AP2, Visa TAP + ICC, Mastercard Agent Pay, Amex ACE, Google/Shopify UCP, OpenAI ACP, and others). Maintained by Genesis Software Group, Copenhagen. Updated April 2026. CC BY 4.0.
MCP Server for Lightning Faucet - Give your AI agent a Bitcoin wallet
Give your AI agents a fetch() that pays. Multi-protocol, multi-chain, open source.
MCP server for 402 Index: discover 15,000+ paid API endpoints across L402, x402, and MPP