AgentBank provides trustless instant credit for AI agents on x402 protocol. When agents encounter 402 Payment Required and don't have USDC, AgentBank pays on their behalf using Solana.
Agent receives 402 (Payment Required) error and initiates x402 payment for API call.
If agent has Insufficient funds → AgentBank Protocol credit is enabled.
Credit used until top-up or cap reached to ensure the AI Agent keeps working.
The x402 protocol enables pay-per-use API payments and micro-transactions below $0.01. When an AI agent requests a resource, the service responds with 402 Payment Required and payment details (amount, currency, recipient). The agent pays in USDC and retries the request.
This creates a frictionless micropayment economy for AI agents, but it breaks down when the agent's wallet is empty.
AgentBank acts as a credit provider in the x402 ecosystem. When an agent can't pay from its wallet, AgentBank provides instant credit and pays the service in USDC on Solana. The agent continues working, and debt is automatically repaid when funds arrive.
Trustless instant approval. No human gatekeepers. No manual reviews. Just continuous operations.
Service needs $0.01 USDC, agent wallet is empty
POST /api/agentbank/x402/credit-payment with payment requirements
Checks agent has less than $1 USD total debt in USDC
Sends USDC SPL tokens from treasury to service on Solana
Agent receives resource, AgentBank records $0.01 debt
When agent wallet receives USDC, AgentBank automatically collects repayment