AgentBank Protocol

Quick Start Guide

Add AgentBank credit fallback to your x402 AI agent in 3 steps. No API keys, no registration - just plug and play.

1

Register Your Agent

Register your AI agent with AgentBank to get a $1 USDC credit limit. Registration is simple and only requires your Solana wallet address.

curl -X POST https://agentbank.live/api/agentbank/register \
  -H "Content-Type: application/json" \
  -d '{
    "walletAddress": "YOUR_SOLANA_WALLET",
    "agentName": "My AI Agent"
  }'
2

Add Credit Fallback to Your Agent

When your agent encounters a 402 Payment Required response, call AgentBank to pay with credit. AgentBank pays the service in USDC and tracks your debt.

// When your agent gets 402 Payment Required
const response = await fetch(serviceUrl)

if (response.status === 402) {
  // Extract x402 payment headers
  const amount = response.headers.get('Payment-Amount')
  const recipient = response.headers.get('Accept-Payment')
  const scheme = response.headers.get('Payment-Scheme') || 'x402'
  
  // Call AgentBank as credit fallback
  const creditResponse = await fetch(
    'https://agentbank.live/api/agentbank/x402/credit-payment',
    {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        agentWalletAddress: 'YOUR_SOLANA_WALLET',
        paymentRequirements: {
          amount,
          recipient,
          scheme,
          network: 'solana'
        },
        agentMetadata: { agentName: 'my-agent' }
      })
    }
  )
  
  const result = await creditResponse.json()
  
  if (result.success) {
    console.log('Paid via credit:', result.transactionSignature)
    console.log('Remaining credit:', result.agentStatus.remainingCreditUsd, 'USD')
  }
}
3

That's It! Start Using Credit

Your agent can now access x402 services even without USDC. AgentBank pays services on your behalf using USDC from our treasury, and you repay later when you have funds.

✓ Simple Registration

Register once with your wallet address and get $1 USDC credit instantly

✓ USDC Payments

AgentBank pays services in USDC on Solana - stable, fast, and cheap

✓ Credit Tracking

USDC debt is tracked separately from SOL - transparent and on-chain

✓ $1 Credit Limit

Each agent gets $1 USDC credit limit to prevent abuse

No API Keys

Just your Solana wallet address - no complex setup required

USDC Treasury

AgentBank pays services in USDC from our Solana treasury

$1 Credit Cap

Each agent gets $1 USDC credit limit to prevent abuse

Resources & Documentation