Decentralized Banking Platform for Autonomous AI Agents
Complete guide to register, manage wallets, execute transactions, and operate your AI agent's finances autonomously
https://api.agentsbank.online
AgentsBank is a complete banking platform built specifically for autonomous AI agents. Unlike traditional banking APIs, AgentsBank enables:
Follow these steps to get your AI agent banking:
Add AgentsBank to your agent's dependencies:
npm install @agentsbank/sdkimport { AgentsBankSDK } from '@agentsbank/sdk';
const bank = new AgentsBankSDK({
apiUrl: 'https://api.agentsbank.online',
});Your agent registers itself and its human owner:
const result = await bank.registerSelf({
humanUsername: 'alice',
humanEmail: 'alice@example.com',
firstName: 'ChatBot',
lastName: 'Pro',
agentPassword: 'SecurePass123!'
});
console.log('Agent registered:', result.agentUsername);
console.log('DID:', result.did);// Create Ethereum wallet
const ethWallet = await bank.createWallet('ethereum');
console.log('ETH address:', ethWallet.address);
// Create Solana wallet
const solWallet = await bank.createWallet('solana');
console.log('SOL address:', solWallet.address);const tx = await bank.sendTransaction(
ethWallet.wallet_id,
'0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1',
'0.1',
'ETH'
);
console.log('Transaction:', tx.tx_hash);
console.log('Status:', tx.status);Agents can register in two ways:
Your agent prompts for information interactively:
const result = await bank.registerSelf();
// Agent will ask:
// Human username: alice
// Human email: alice@example.com
// Agent first name: ChatBot
// Agent last name: Pro
// Agent password: SecurePass123!Pre-configure all values:
const result = await bank.registerSelf({
humanUsername: 'alice',
humanEmail: 'alice@example.com',
firstName: 'ChatBot',
lastName: 'Pro',
agentPassword: 'SecurePass123!'
});After registration, your agent receives:
After registration, create wallets on any supported blockchain:
| Chain ID | Network | Primary Asset |
|---|---|---|
ethereum |
Ethereum Mainnet | ETH |
bsc |
Binance Smart Chain | BNB |
solana |
Solana Mainnet | SOL |
bitcoin |
Bitcoin Mainnet | BTC |
// Create Ethereum wallet
const ethWallet = await bank.createWallet('ethereum');
console.log('Address:', ethWallet.address);
console.log('Wallet ID:', ethWallet.wallet_id);
// Create Solana wallet
const solWallet = await bank.createWallet('solana');
// Create Bitcoin wallet
const btcWallet = await bank.createWallet('bitcoin');const balance = await bank.getBalance(walletId);
console.log(balance);
// Returns:
// {
// ETH: '1.5',
// USDC: '100.50',
// DAI: '50.00',
// USD_VALUE: '3250.75'
// }const wallets = await bank.listWallets();
wallets.forEach(wallet => {
console.log(`${wallet.chain}: ${wallet.address}`);
});const tx = await bank.sendTransaction(
walletId, // Your wallet ID
'0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1', // Recipient
'0.5', // Amount
'ETH' // Asset
);
console.log('Transaction Hash:', tx.tx_hash);
console.log('Status:', tx.status); // pending, confirmed, or failedconst tx = await bank.sendTransaction(
walletId,
'0x742d35...',
'100',
'USDC',
{
gasPrice: 'auto', // or specific gwei
gasLimit: 100000, // custom limit
memo: 'Payment for API', // optional note
priority: 'standard' // low, standard, or high
}
);const status = await bank.getTransactionStatus(txHash);
console.log('Status:', status.status); // pending, confirmed, failed
console.log('Confirmations:', status.confirmations);
console.log('Block:', status.block_number);// Get recent transactions
const history = await bank.getTransactionHistory(walletId);
// With filters
const recent = await bank.getTransactionHistory(walletId, {
limit: 50,
offset: 0,
status: 'confirmed',
asset: 'ETH'
});If you prefer direct REST API calls instead of the SDK, use these endpoints:
Register agent and human owner autonomously
No Auth Requiredcurl -X POST https://api.agentsbank.online/api/auth/agent/register-self \
-H "Content-Type: application/json" \
-d '{
"human_username": "alice",
"human_email": "alice@example.com",
"first_name": "ChatBot",
"last_name": "Pro",
"agent_password": "SecurePass123!"
}'Response:
{
"agent_id": "uuid",
"agent_username": "agent_1706...",
"token": "eyJhbGciOiJIUzI1NiIs...",
"did": "did:agentsbank:uuid",
"api_key": "sk_agent_xyz123...",
"message": "Agent self-registered successfully"
}Login with agent credentials
No Auth Requiredcurl -X POST https://api.agentsbank.online/api/auth/agent/login \
-H "Content-Type: application/json" \
-d '{
"agent_username": "agent_1706...",
"agent_password": "SecurePass123!"
}'Create new wallet on specified chain
Auth Required (Agent Token)curl -X POST https://api.agentsbank.online/api/wallets \
-H "Authorization: Bearer <agent-token>" \
-H "Content-Type: application/json" \
-d '{ "chain": "ethereum" }'Response:
{
"wallet_id": "uuid",
"agent_id": "uuid",
"chain": "ethereum",
"address": "0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1",
"type": "custodial",
"created_at": "2026-02-07T..."
}Get all wallets for agent
Auth Required (Agent Token)curl -X GET https://api.agentsbank.online/api/wallets \
-H "Authorization: Bearer <agent-token>"Get current balance of wallet
Auth Required (Agent Token)curl -X GET https://api.agentsbank.online/api/wallets/uuid/balance \
-H "Authorization: Bearer <agent-token>"Response:
{
"ETH": "1.5",
"USDC": "100.50",
"DAI": "50.00",
"USD_VALUE": "3250.75"
}Execute transaction from wallet
Auth Required (Agent Token)curl -X POST https://api.agentsbank.online/api/transactions/send \
-H "Authorization: Bearer <agent-token>" \
-H "Content-Type: application/json" \
-d '{
"wallet_id": "uuid",
"to_address": "0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1",
"amount": "0.5",
"asset": "ETH",
"gas_price": "auto"
}'Response:
{
"tx_hash": "0x1234567890abcdef...",
"wallet_id": "uuid",
"chain": "ethereum",
"from_address": "0x742d35...",
"to_address": "0x999...",
"amount": "0.5",
"asset": "ETH",
"status": "pending",
"fee": "0.000945",
"created_at": "2026-02-07T10:35:00Z"
}Get transaction history for wallet
Auth Required (Agent Token)curl -X GET "https://api.agentsbank.online/api/wallets/uuid/transactions?limit=50&status=confirmed" \
-H "Authorization: Bearer <agent-token>"List all supported blockchains (no auth needed)
No Auth Requiredcurl -X GET https://api.agentsbank.online/api/catalogue/chainsGet real-time token prices (no auth needed)
No Auth Requiredcurl -X GET https://api.agentsbank.online/api/catalogue/pricesimport { AgentsBankSDK } from '@agentsbank/sdk';
// Step 1: Initialize
const bank = new AgentsBankSDK({
apiUrl: 'https://api.agentsbank.online'
});
// Step 2: Register agent and owner
const registration = await bank.registerSelf({
humanUsername: 'alice',
humanEmail: 'alice@example.com',
firstName: 'Trading',
lastName: 'Bot',
agentPassword: 'SecurePass123!'
});
console.log('✅ Registered:', registration.agentUsername);
console.log('🆔 DID:', registration.did);
// Step 3: Create wallets on different chains
const ethWallet = await bank.createWallet('ethereum');
const solWallet = await bank.createWallet('solana');
const bscWallet = await bank.createWallet('bsc');
console.log('💳 Wallets:');
console.log('ETH:', ethWallet.address);
console.log('SOL:', solWallet.address);
console.log('BSC:', bscWallet.address);
// Step 4: Check balances
const ethBalance = await bank.getBalance(ethWallet.wallet_id);
console.log('💰 ETH Balance:', ethBalance);
// Step 5: Send transaction
const tx = await bank.sendTransaction(
ethWallet.wallet_id,
'0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1',
'0.1',
'ETH'
);
console.log('📤 TX Hash:', tx.tx_hash);
console.log('Status:', tx.status);async function monitorTransactions() {
const wallets = await bank.listWallets();
for (const wallet of wallets) {
const txs = await bank.getTransactionHistory(
wallet.wallet_id,
{ status: 'pending', limit: 100 }
);
console.log(`${wallet.chain}: ${txs.length} pending`);
for (const tx of txs) {
const status = await bank.getTransactionStatus(tx.tx_hash);
console.log(` ${tx.amount} ${tx.asset}`);
console.log(` Confirmations: ${status.confirmations}`);
}
}
}
// Run every 30 seconds
setInterval(monitorTransactions, 30000);async function distributePayment(recipients, amount) {
const wallets = await bank.listWallets();
for (const wallet of wallets) {
console.log(`Distributing on ${wallet.chain}...`);
for (const recipient of recipients) {
const tx = await bank.sendTransaction(
wallet.wallet_id,
recipient,
amount,
'USDC' // Use stablecoin
);
console.log(`✓ Sent to ${recipient}: ${tx.tx_hash}`);
}
}
}
// Usage
await distributePayment([
'0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1',
'0x999d35Cc6634C0532925a3b844Bc4e7595f42bE1'
], '100');async function monitorBalances() {
const wallets = await bank.listWallets();
const thresholds = {
'ETH': 0.1,
'SOL': 1,
'USDC': 100
};
for (const wallet of wallets) {
const balance = await bank.getBalance(wallet.wallet_id);
for (const [asset, amount] of Object.entries(balance)) {
const threshold = thresholds[asset] || 0;
if (parseFloat(amount) < threshold) {
console.warn(`⚠️ LOW: ${amount} ${asset} on ${wallet.chain}`);
console.warn(`Wallet: ${wallet.address}`);
// Send alert notification
}
}
}
}
setInterval(monitorBalances, 60000);Comprehensive API documentation for autonomous agent operations across all chains.
Self-register agent with human owner (agent creates its own account)
Public Request Body:{
"human_username": "alice", // Human owner username
"human_email": "alice@example.com", // Human owner email
"first_name": "Trading", // Agent display name
"last_name": "Bot", // Agent display surname
"agent_password": "SecurePass123!" // Secret password for agent
}{
"agent_id": "uuid",
"agent_username": "agent_1706...", // Unique agent identifier
"token": "eyJhbGciOiJIUzI1NiIs...", // JWT for API calls
"did": "did:agentsbank:uuid", // Decentralized Identifier
"api_key": "sk_agent_xyz123...", // Long-lived API key
"message": "Agent self-registered successfully"
}Login with agent credentials to get fresh token
Public Request Body:{
"agent_username": "agent_1706...",
"agent_password": "SecurePass123!"
}{
"token": "eyJhbGciOiJIUzI1NiIs...",
"api_key": "sk_agent_xyz123...",
"agent_id": "uuid",
"did": "did:agentsbank:uuid"
}Create new custodial wallet on specified blockchain
Agent Token Required Request Body:{
"chain": "ethereum" // ethereum | bsc | solana | bitcoin
}{
"wallet_id": "uuid",
"agent_id": "uuid",
"chain": "ethereum",
"address": "0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1",
"type": "custodial",
"created_at": "2026-02-07T10:35:00Z",
"recovery_phrase_required": true
}List all wallets for agent with pagination
Agent Token Required Query Parameters:?limit=100&offset=0[
{
"wallet_id": "uuid",
"chain": "ethereum",
"address": "0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1",
"type": "custodial",
"created_at": "2026-02-07T10:35:00Z"
},
{
"wallet_id": "uuid",
"chain": "solana",
"address": "7z9b4vQ...",
"type": "custodial",
"created_at": "2026-02-07T10:36:00Z"
}
]Get wallet details and metadata
Agent Token Required Response (200 OK):{
"wallet_id": "uuid",
"chain": "ethereum",
"address": "0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1",
"type": "custodial",
"created_at": "2026-02-07T10:35:00Z",
"updated_at": "2026-02-07T10:35:00Z"
}Get current balance of wallet across all assets
Agent Token Required Response (200 OK):{
"ETH": "1.5",
"USDC": "100.50",
"DAI": "50.00",
"USD_VALUE": "3250.75",
"updated_at": "2026-02-07T10:35:00Z"
}Send transaction from agent's wallet
Agent Token Required Request Body:{
"wallet_id": "uuid",
"to_address": "0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1",
"amount": "0.5",
"asset": "ETH",
"gas_price": "auto", // auto | custom gwei value
"memo": "Payment", // optional note
"priority": "standard" // low | standard | high
}{
"tx_hash": "0x1234567890abcdef...",
"wallet_id": "uuid",
"chain": "ethereum",
"from_address": "0x742d35...",
"to_address": "0x999...",
"amount": "0.5",
"asset": "ETH",
"status": "pending",
"fee": "0.000945",
"confirmation_time": null,
"created_at": "2026-02-07T10:35:00Z"
}Get transaction status and details
Agent Token Required Response (200 OK):{
"tx_hash": "0x1234567890abcdef...",
"status": "confirmed",
"confirmations": 12,
"block_number": 19205485,
"block_timestamp": "2026-02-07T10:37:00Z",
"gas_used": 21000,
"gas_price": "25.5",
"transaction_fee": "0.000945"
}Get transaction history with filtering
Agent Token Required Query Parameters:?limit=50&offset=0&status=confirmed&asset=ETH[
{
"tx_hash": "0x1234567890abcdef...",
"amount": "0.5",
"asset": "ETH",
"status": "confirmed",
"direction": "sent",
"to_address": "0x999...",
"created_at": "2026-02-07T10:35:00Z"
},
{
"tx_hash": "0x9876543210fedcba...",
"amount": "2.0",
"asset": "ETH",
"status": "confirmed",
"direction": "received",
"from_address": "0x111...",
"created_at": "2026-02-06T15:20:00Z"
}
]Estimate gas cost for transaction (EVM chains only)
Agent Token Required Request Body:{
"wallet_id": "uuid",
"to_address": "0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1",
"amount": "0.5",
"asset": "ETH"
}{
"estimated_gas": 21000,
"gas_price_gwei": "25.5",
"total_fee_eth": "0.000945",
"total_fee_usd": "1.89",
"is_available": true
}Sign message with wallet (no transaction)
Agent Token Required Request Body:{
"message": "Verify agent identity"
}{
"signature": "0x1234567890abcdef...",
"message": "Verify agent identity",
"signer": "0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1"
}Get list of supported chains (no auth needed)
Public Response (200 OK):[
{
"id": "ethereum",
"name": "Ethereum",
"network": "mainnet",
"rpc": "https://...",
"primary_asset": "ETH",
"supports": ["native", "tokens"],
"testnet_id": "ethereum-sepolia"
},
{
"id": "solana",
"name": "Solana",
"network": "mainnet",
"rpc": "https://...",
"primary_asset": "SOL",
"supports": ["native", "spl-tokens"]
}
]Get real-time token prices (no auth needed)
Public Response (200 OK):{
"ETH": { "usd": 2450.50, "updated_at": "2026-02-07T10:35:00Z" },
"BNB": { "usd": 612.30, "updated_at": "2026-02-07T10:35:00Z" },
"SOL": { "usd": 185.45, "updated_at": "2026-02-07T10:35:00Z" },
"BTC": { "usd": 45230.00, "updated_at": "2026-02-07T10:35:00Z" },
"USDC": { "usd": 1.00, "updated_at": "2026-02-07T10:35:00Z" }
}// ✅ Good: Use environment variables
const bank = new AgentsBankSDK({
apiUrl: process.env.AGENTSBANK_API_URL,
token: process.env.AGENT_TOKEN
});
// ❌ Bad: Never do this!
const bank = new AgentsBankSDK({
apiUrl: 'https://api.agentsbank.online',
token: 'eyJhbGciOiJIUzI1NiIs...' // DON'T HARDCODE!
});Your human owner can set spending limits to prevent unauthorized high-value transactions:
// Set by human owner with human JWT token
const guardrails = {
max_daily_spend: '1000',
max_transaction_amount: '100',
whitelist_addresses: [
'0x742d35Cc6634C0532925a3b844Bc4e7595f42bE1',
'0x999d35Cc6634C0532925a3b844Bc4e7595f42bE1'
],
allowed_chains: ['ethereum', 'solana'],
allowed_assets: ['ETH', 'USDC', 'SOL']
};// Always include JWT token in Authorization header
const headers = {
'Authorization': `Bearer ${agentToken}`,
'Content-Type': 'application/json'
};
fetch('https://api.agentsbank.online/api/wallets', {
method: 'GET',
headers: headers
});AgentsBank is a banking platform built for autonomous AI agents. It lets your agent independently manage wallets, track balances, send transactions, and handle finances across multiple blockchains.
Yes! Your agent is fully autonomous and can send transactions without human approval. However, your human owner can set guardrails (spending limits, whitelists) to ensure safety.
Yes, it's built for production with enterprise-grade security, encryption, database-level security (ROW-LEVEL SECURITY), and multi-chain support.
Call `bank.registerSelf()` in the SDK or POST to `/api/auth/agent/register-self`. You'll need your human owner's username and email.
Store your recovery words in a secure location during registration. You can use them to recover your account.
Unlimited! Create as many agents as you need for different tasks.
Unlimited wallets per chain. We recommend one wallet per chain for organization.
Ethereum, Binance Smart Chain (BSC), Solana, and Bitcoin (both mainnet and testnet).
Ethereum: 12-30s • BSC: 3-6s • Solana: 2-4s • Bitcoin: 10-60 minutes
No, confirmed transactions on the blockchain cannot be reversed. Plan carefully before sending!
Failed transactions typically return your funds minus gas fees. Check the transaction status with `getTransactionStatus()`.
Only the human owner can set guardrails using their human JWT token.
The transaction is rejected with a clear error message explaining which guardrail was violated.
For custodial wallets, keys are encrypted at rest and never transmitted. AgentsBank handles key management securely.
Check the error message. Common issues:
• Invalid password (doesn't meet requirements)
• Duplicate username (try a different one)
• Invalid email format
• Network connectivity issue
Check:
• Do you have enough balance + gas fees?
• Is the recipient address correct?
• Are you within guardrails?
• Is the network congested?
• Is your wallet funded?
Use faucets:
• Ethereum Sepolia: https://sepolia-faucet.pk910.de/
• BSC Testnet: https://testnet.binance.org/faucet-smart
• Solana Devnet: `solana airdrop 1`
Use `getTransactionHistory()` to view all transactions, and `getBalance()` to check balances. Set up periodic monitoring tasks.
Check GitHub discussions, the documentation, or contact support through docs.agentsbank.online
For a complete, type-safe client experience, use the official AgentsBank SDK:
npm install @agentsbankai/sdkimport { AgentsBank } from '@agentsbankai/sdk';
// Human registration
const client = new AgentsBank();
const humanToken = await client.auth.registerHuman(
'alice',
'alice@example.com',
'password'
);
// Create agent
const { token, recoveryWords } = await client.auth.registerAgent(
'Alice',
'Agent',
'agent_password',
humanToken
);
// Agent operations
const agentClient = new AgentsBank(token);
const wallets = await agentClient.wallet.getWallet('all');
const tx = await agentClient.transaction.send(
walletId,
recipientAddress,
'1.0',
'ETH'
);Full SDK documentation:
All errors include a JSON response with an error field. Example:
{
"error": "Unauthorized: Invalid API key",
"code": "INVALID_API_KEY",
"details": { "hint": "Check X-API-Key header" }
}
| Status | Error Code | Meaning | Action |
|---|---|---|---|
| 400 | BAD_REQUEST | Malformed request, missing/invalid fields | Check request body and parameters |
| 401 | UNAUTHORIZED | Invalid/missing/expired token or API key | Re-authenticate or check credentials |
| 403 | FORBIDDEN | Not authorized (e.g., not wallet owner) | Verify ownership or permissions |
| 404 | NOT_FOUND | Resource doesn't exist (wallet, tx, agent) | Check IDs and try again |
| 409 | CONFLICT | Operation cannot be completed (no funds, pending tx) | Wait or add funds and retry |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests in time window | Wait (see Retry-After header) and retry |
| 500 | SERVER_ERROR | Unexpected server error | Retry with exponential backoff |
| 503 | SERVICE_UNAVAILABLE | API temporarily down for maintenance | Retry after status check |
Problem: Response is missing wallet_id field.
Solution: Upgrade SDK to v1.0.4+. Ensure you're using the latest version:
npm install @agentsbankai/sdk@latestProblem: Getting too many 429 responses.
Solution: Implement exponential backoff and respect X-RateLimit-Remaining header:
// Check before making requests
if (remainingRequests < 10) {
console.log('Approaching rate limit, waiting...');
await sleep(60000);
}
// On 429, exponentially backoff
async function retryWithBackoff(fn, attempt = 0) {
try {
return await fn();
} catch (e) {
if (e.status === 429 && attempt < 3) {
const delay = Math.pow(2, attempt) * 1000; // 1s, 2s, 4s
await sleep(delay);
return retryWithBackoff(fn, attempt + 1);
}
throw e;
}
}
Problem: TX created but never confirms.
Solution: This can happen during network congestion. Possible actions:
Problem: Balance exists but can't send transaction.
Solution: Likely not accounting for gas fees. Use estimateGas first:
const estimate = await client.estimateGas(walletId, recipient, amount);
console.log('Total cost:', parseFloat(estimate.estimated_gas) + parseFloat(amount));
// Ensure balance covers both amount + gas
const balance = await client.getBalance(walletId);
if (parseFloat(balance.ETH) < totalCost) {
console.error('Insufficient balance for amount + gas');
}
Answer:
Answer: Depends on chain and transaction type:
Always call estimateGas before sending important transactions.
Recommended Flow:
// 1. Use testnet API endpoint (if available)
const testClient = createClient({
apiUrl: 'https://testnet.api.agentsbank.online'
});
// 2. Get testnet funds from faucet
// Sepolia: https://faucet.sepolia.dev
// Solana Devnet: Auto-funded
// 3. Test all operations
await testClient.register({...});
const wallet = await testClient.createWallet('sepolia');
await testClient.send(wallet.wallet_id, {...});
// 4. Once working, switch to production
const prodClient = createClient({
apiUrl: 'https://api.agentsbank.online'
});