AgentBank × PayAI Integration
PayAI facilitator integration for AgentBank. Faster settlements, better reliability, and seamless x402 protocol payments using PayAI's infrastructure.
PayAI Facilitator
Routes payments through PayAI's facilitator for faster verification and settlement
Same Credit System
$1 USDC initial credit limit, same security, same auto-repayment - just faster
Faster Settlements
<1 second settlement vs 2-3 seconds with direct Solana payments
What is PayAI?
PayAI is a decentralized payment facilitator for the x402 protocol. Instead of sending payments directly to Solana, PayAI routes them through their facilitator infrastructure for faster verification, settlement, and better reliability.
Why Use PayAI Integration?
- ✅ Official PayAI integration - "Powered by PayAI"
- ⚡ Faster settlements (<1 second vs 2-3 seconds)
- 🔒 Better reliability through facilitator infrastructure
- 🎯 Same credit system, security, and rate limiting
- 🌐 Multi-network support (Solana, Base, Avalanche, etc.)
Quick Start: 3 Steps to Integrate
Already using AgentBank? Switch to PayAI facilitator in 3 simple steps:
Change API Endpoint
Replace the x402 endpoint with the PayAI endpoint:
// Before (direct x402)
const url = 'https://agentbank.live/api/agentbank/x402/credit-payment'
// After (PayAI facilitator)
const url = 'https://agentbank.live/api/agentbank/payai/credit-payment'Same Request Format
The request format is identical - no code changes needed:
const result = await fetch(
'https://agentbank.live/api/agentbank/payai/credit-payment',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
agentWalletAddress: 'YOUR_WALLET_ADDRESS',
paymentRequirements: {
amount: '0.01',
recipient: 'SERVICE_WALLET_ADDRESS',
scheme: 'usdc-solana',
network: 'solana-mainnet'
},
agentMetadata: {
agentName: 'My AI Agent',
service: 'api.example.com'
}
})
}
)
const data = await result.json()
if (data.success) {
console.log('✅ Paid via PayAI facilitator')
console.log('Transaction:', data.transactionSignature)
console.log('Facilitator proof:', data.facilitatorProof)
console.log('Current debt:', data.agentStatus.currentUsdcDebt, 'USDC')
}Enjoy Faster Payments
That's it! Your payments now route through PayAI's facilitator for faster settlements.
🎉 You're using PayAI!
Your agent now uses PayAI's facilitator infrastructure for faster, more reliable x402 payments. Same credit system, same security, just better performance.
How PayAI Integration Works
- 1. Agent requests resource → Service responds 402 Payment Required (needs $0.01 USDC)
- 2. Agent calls AgentBank PayAI endpoint → POST /api/agentbank/payai/credit-payment
- 3. AgentBank validates credit → Checks agent has credit available (under $1 USD total)
- 4. AgentBank sends USDC payment → Sends USDC SPL tokens to service
- 5. PayAI facilitator verifies → Calls PayAI /verify endpoint
- 6. PayAI facilitator settles → Calls PayAI /settle endpoint
- 7. Service grants access → Agent receives resource, debt recorded
- 8. Auto-repayment → When agent earns USDC, debt is automatically repaid
API Reference
POST /api/agentbank/payai/credit-payment
Request credit payment using PayAI facilitator
{
"agentWalletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"paymentRequirements": {
"amount": "0.01",
"recipient": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
"scheme": "usdc-solana",
"network": "solana-mainnet"
},
"agentMetadata": {
"agentName": "My AI Agent",
"service": "api.example.com",
"requestId": "req_123"
}
}{
"success": true,
"paymentMethod": "credit",
"transactionSignature": "5j7s8K9mN2pQ3rT4vW5xY6zA7bC8dE9fG0hI1jK2lM3nO4pQ5rS6tU7vW8xY9z",
"facilitatorProof": "proof_abc123...",
"creditTransactionId": "550e8400-e29b-41d4-a716-446655440000",
"amountPaid": 0.01,
"currency": "USDC",
"network": "solana",
"facilitator": "payai",
"agentStatus": {
"currentUsdcDebt": 0.01,
"usdcCreditLimit": 1.0,
"remainingCreditUsd": 0.99,
"credibilityScore": 50
}
}GET /api/agentbank/payai/check
Check agent credit status for PayAI integration
GET /api/agentbank/payai/check?agentWalletAddress=7xKXtg...{
"registered": true,
"facilitator": "payai",
"agent": {
"walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"agentName": "My AI Agent",
"status": "active",
"credibilityScore": 50
},
"credit": {
"currentUsdcDebt": 0.0,
"usdcCreditLimit": 1.0,
"remainingCreditUsd": 1.0,
"totalBorrowedUsdc": 0.0,
"totalRepaidUsdc": 0.0
},
"lastActivity": "2025-01-15T10:30:00Z"
}PayAI vs Direct x402
| Feature | Direct x402 | PayAI Facilitator |
|---|---|---|
| Settlement Time | 2-3 seconds | <1 second |
| Credit Limit | $1 USD | $1 USD |
| Security | Same | Same |
| Rate Limiting | Same | Same |
| Auto-Repayment | Same | Same |
| Infrastructure | Direct Solana | PayAI Facilitator |
| Reliability | Good | Better |
| Multi-Network | Solana only | Solana, Base, Avalanche, etc. |
Supported Networks
PayAI facilitator supports multiple blockchain networks. AgentBank currently uses Solana, but PayAI's infrastructure supports:
- ✅ Solana (mainnet)
- ✅ Solana Devnet (testing)
- ✅ Base
- ✅ Avalanche
- ✅ IoTeX
- ✅ Sei
Migration Guide
Already using AgentBank's direct x402 integration? Here's how to migrate to PayAI:
// Before
const endpoint = 'https://agentbank.live/api/agentbank/x402/credit-payment'
// After
const endpoint = 'https://agentbank.live/api/agentbank/payai/credit-payment'The request and response formats are identical. Your existing code will work without modifications.
Test with a small payment to verify the integration works. You'll see faster settlement times immediately.
Deploy your changes. Both endpoints work in parallel - you can switch back anytime.
Ready to use PayAI?
Start using PayAI's facilitator infrastructure for faster, more reliable x402 payments. Same credit system, same security, just better performance.
POST https://agentbank.live/api/agentbank/payai/credit-payment