The payment layer for autonomous AI agents. Fund via Telegram Stars or crypto, set spending rules, let your agent operate independently.
AI agents can browse, code, deploy β but can't spend money without a human in the loop. AgentPay fixes that.
| Problem | AgentPay Solution |
|---|---|
| Agent needs to pay for an API | Autonomous spending via REST API |
| No on-chain wallet for agents | Multi-chain USDC wallets (Base, Polygon, BNB, Solana) |
| Agents can't hold or transfer funds | Agent-to-agent transfers, refunds, webhooks |
| Payment UIs don't fit agent workflows | Pure API + Python SDK + MCP tools |
| Expensive/complex infrastructure | Self-hosted, open-source, 0% fees (beta) |
Open @FundmyAIbot in Telegram β /newagent β Copy your API key (shown once)
Send Telegram Stars through the bot, or deposit USDC to the agent's Base wallet.
from agentpay import AgentPayClient
client = AgentPayClient("ap_xxxx...")
# Check balance
balance = client.get_balance()
print(f"Balance: ${balance.balance_usd}")
# Spend
tx = client.spend(amount=5.00, description="GPT-4 batch")
print(f"Spent ${tx.amount}, remaining ${tx.remaining_balance}")
# Transfer between agents
client.transfer(to_agent_id="agent_456", amount=10.00)
# Webhook for real-time events
webhook = client.register_webhook(url="https://your-server.com/hook", events=["transaction.completed"])Or use the REST API directly:
curl -X POST https://leofundmybot.dev/v1/spend \
-H "X-API-Key: ap_xxxx..." \
-H "Content-Type: application/json" \
-d '{"amount": 5.00, "description": "API usage"}'Payments
- β Telegram Stars funding (instant, in-app)
- π Multi-chain USDC wallets β Base, Polygon, BNB Chain, Solana
- πΈ Agent-to-agent transfers
- β©οΈ Refunds & transaction reversal
- π x402 protocol support (HTTP-native payments)
Agent Identity (KYA β Know Your Agent)
- πͺͺ Agent identity profiles with trust scores (0-100)
- π Trust score based on: account age, tx count, volume, profile, verified badge
- π Public agent directory with category filtering
- β Verified agent badges
- π ERC-8004 compatible registration files (Trustless Agents standard)
Security
- π SHA-256 hashed API keys (Stripe-style β shown once, never stored)
- π Key rotation endpoint
- π‘οΈ Fernet+PBKDF2 encrypted wallet keys at rest
- π¦ Per-key rate limiting (60 req/min)
- π CORS lockdown + security headers (HSTS, CSP, Referrer-Policy, Permissions-Policy)
- π§± UFW firewall + fail2ban + SSH hardening
- π Pen-tested: Nmap, Nikto, SQLmap β zero vulnerabilities
Developer Experience
- π Full OpenAPI docs at
/docsand/redoc - π Python SDK (sync + async, Pydantic v2 models)
- π€ MCP tool definitions (8 tools for agent frameworks)
- π Webhooks with HMAC-SHA256 signatures
- β Idempotent operations
- π CSV export for accounting
Control
- β Approval workflows β require human sign-off above spending thresholds
- π± Telegram Mini App dashboard
- π Landing page + docs site
Telegram Bot (@FundmyAIbot)
β creates agents, funds wallets
AgentPay API (FastAPI, 29 endpoints)
β β
Telegram Stars Multi-chain USDC
(internal ledger) (Base/Polygon/BNB/Solana)
β β
β Webhooks push events to your agent in real-time
Stack: Python (aiogram + FastAPI), PostgreSQL, Alembic, Cloudflare Tunnel
git clone https://github.com/lfp22092002-ops/agentpay.git
cd agentpay
cp .env.example .env # Configure your keys
pip install -r requirements.txt
alembic upgrade head
uvicorn api.main:app --host 0.0.0.0 --port 8080Requires: Python 3.11+, PostgreSQL, a Telegram Bot Token.
| Category | Endpoints |
|---|---|
| Agent | Create, get, list, update, delete, rotate API key |
| Balance | Get balance, deposit, spend, transfer, refund |
| Identity | Create/update profile, get trust score, public directory |
| Dashboard | Aggregate stats, agent analytics, spending breakdown |
| Webhooks | Create, list, delete, test |
| Wallets | Get addresses (Base, Polygon, BNB, Solana) |
| Chains | List supported chains, chain status |
| Export | CSV transaction history |
| x402 | Probe, pay (HTTP 402 payment flow) |
| Health | Status, version |
Full interactive docs: leofundmybot.dev/docs
AgentPay ships with MCP (Model Context Protocol) tool definitions so any AI agent framework can use it natively:
{
"tools": [
"agentpay_get_balance",
"agentpay_spend",
"agentpay_transfer",
"agentpay_list_transactions",
"agentpay_create_webhook",
"agentpay_get_wallet_address",
"agentpay_check_approval",
"agentpay_x402_pay"
]
}Works with LangChain, CrewAI, OpenClaw, and any MCP-compatible agent.
| Setup | Free |
| Transactions | 0% fees (beta) |
| Monthly | $0 |
| Self-hosted | Free forever |
- Multi-chain USDC wallets (Base, Polygon, BNB, Solana)
- Agent Identity System (KYA β Know Your Agent) with trust scores
- ERC-8004 Trustless Agents compatibility
- Security audit β pen-tested with Nmap, Nikto, SQLmap (0 vulns)
- Security model whitepaper (docs/security-model.md)
- Dashboard API for analytics
- LangChain / CrewAI native tool wrappers
- Python SDK on PyPI (
pip install agentpay) - TypeScript SDK on npm
- Virtual Visa cards via Lithic
- Telegram Stars production payments
- ERC-8004 on-chain registration (Phase 2)
- Dashboard UI (web frontend)
- Payee whitelists (allow/deny rules with per-payee caps)
- Google AP2 + Stripe Agentic Commerce compatibility
- x402 facilitator mode (settle payments for other agents)
- π€ Bot: @FundmyAIbot
- π Website: leofundmybot.dev
- π API Docs: leofundmybot.dev/docs
- π Security Model: docs/security-model.md
- π ERC-8004 Discovery: .well-known/erc-8004.json
- π SDK:
sdk/agentpay/ - π§ MCP Tools:
mcp/
PRs welcome. Open an issue first for big changes.
MIT β see LICENSE
Built for the agent economy. Because autonomous agents deserve their own wallets.