Build an AI Agent with Crypto Wallet Access in 5 Minutes
Give your AI agent its own crypto wallet. Create HD wallets, check balances across 9 chains, get live price feeds, and execute token swaps — all with one API key and zero blockchain code.
1 Why AI agents need wallets
An AI agent that can only read and write text is limited. The next generation of agents will interact with the real world — and that includes money.
Use cases for wallet-enabled agents:
- Portfolio monitoring — Track balances across chains, alert on large movements
- DeFi automation — Rebalance positions, claim rewards, execute swaps based on market conditions
- Payment agents — Receive payments on behalf of a business, auto-settle to stablecoins
- Treasury management — Multi-sig aware agents that prepare transactions for human approval
- Research bots — Monitor on-chain activity and generate reports
The hard part has always been the blockchain integration: managing private keys, signing transactions, handling different chains and token standards. Agent Gateway abstracts all of this behind a REST API.
2 Architecture overview
Your agent talks to Agent Gateway. The gateway handles authentication, rate limiting, and routing to the right backend service. You get 200 free credits on key creation — no email, no credit card.
3 Get your API key (30 seconds)
One POST request. That's it.
curl -X POST https://agent-gateway-kappa.vercel.app/api/keys/create
4 Create an HD wallet
Generate a hierarchical deterministic (HD) wallet that works across multiple chains. One seed phrase, addresses on every supported chain.
curl
# Generate a new HD wallet
curl -X POST https://agent-gateway-kappa.vercel.app/v1/agent-wallet/wallets/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
/v1/agent-secrets). Never log or commit private keys.
Python
import requests
API_KEY = "gw_your_key_here"
BASE = "https://agent-gateway-kappa.vercel.app"
headers = {"Authorization": f"Bearer {API_KEY}"}
# Create a new wallet
wallet = requests.post(f"{BASE}/v1/agent-wallet/wallets/generate", headers=headers).json()
print(f"Address: {wallet['address']}")
print(f"Chain: {wallet['chain']}")
Node.js
const API_KEY = "gw_your_key_here";
const BASE = "https://agent-gateway-kappa.vercel.app";
const res = await fetch(`${BASE}/v1/agent-wallet/wallets/generate`, {
method: "POST",
headers: { "Authorization": `Bearer ${API_KEY}` }
});
const wallet = await res.json();
console.log("Address:", wallet.address);
Supported chains
The wallet API supports 9 chains: Ethereum, Polygon, Arbitrum, Optimism, Base, BSC, Avalanche, Fantom, and Solana. Derive addresses on any chain from the same seed:
# Derive an address on a specific chain
curl -X POST https://agent-gateway-kappa.vercel.app/v1/agent-wallet/wallets/derive \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"mnemonic": "your twelve word mnemonic phrase here ...", "chain": "base"}'
5 Check balances across chains
Query the native token balance for any address on any supported chain:
# Check ETH balance
curl https://agent-gateway-kappa.vercel.app/v1/agent-wallet/wallets/0x742d.../balance \
-H "Authorization: Bearer YOUR_API_KEY"
Check all chains at once:
# Get balance on all supported chains
curl https://agent-gateway-kappa.vercel.app/v1/agent-wallet/wallets/0x742d.../balance/all \
-H "Authorization: Bearer YOUR_API_KEY"
Check specific ERC-20 token balances:
# Check USDC balance on Base
curl "https://agent-gateway-kappa.vercel.app/v1/agent-wallet/wallets/0x742d.../tokens/0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" \
-H "Authorization: Bearer YOUR_API_KEY"
6 Get live crypto prices
Real-time price feeds for your agent's decision-making. No separate API key needed — it's included in your gateway key.
# Get BTC, ETH, SOL prices
curl "https://agent-gateway-kappa.vercel.app/v1/crypto-feeds/api/prices" \
-H "Authorization: Bearer YOUR_API_KEY"
Get a specific token:
curl "https://agent-gateway-kappa.vercel.app/v1/crypto-feeds/api/price/ETH" \
-H "Authorization: Bearer YOUR_API_KEY"
Set up price alerts (your agent gets notified when thresholds are hit):
# Alert when ETH drops below $2500
curl -X POST "https://agent-gateway-kappa.vercel.app/v1/crypto-feeds/api/alerts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"symbol": "ETH",
"condition": "below",
"price": 2500,
"webhook": "https://your-webhook.example.com/alert"
}'
7 Put it together: autonomous portfolio agent
Here's a complete Python agent that creates a wallet, monitors prices, and reports portfolio status. This is a working script you can run right now.
import requests
import json
import time
# Configuration
BASE = "https://agent-gateway-kappa.vercel.app"
def create_api_key():
"""Get a free API key with 200 credits."""
res = requests.post(f"{BASE}/api/keys/create")
data = res.json()
print(f"API Key: {data['api_key']}")
print(f"Credits: {data['credits']}")
return data["api_key"]
def create_wallet(api_key):
"""Generate a new HD wallet."""
headers = {"Authorization": f"Bearer {api_key}"}
res = requests.post(f"{BASE}/v1/agent-wallet/wallets/generate", headers=headers)
wallet = res.json()
print(f"Wallet created: {wallet['address']}")
return wallet
def get_prices(api_key):
"""Fetch current crypto prices."""
headers = {"Authorization": f"Bearer {api_key}"}
res = requests.get(f"{BASE}/v1/crypto-feeds/api/prices", headers=headers)
return res.json()
def get_balance(api_key, address):
"""Check wallet balance across all chains."""
headers = {"Authorization": f"Bearer {api_key}"}
res = requests.get(
f"{BASE}/v1/agent-wallet/wallets/{address}/balance/all",
headers=headers
)
return res.json()
def store_secret(api_key, key, value):
"""Store sensitive data in the secrets vault."""
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
requests.post(
f"{BASE}/v1/agent-secrets/api/secrets",
headers=headers,
json={"key": key, "value": value}
)
def run_agent():
"""Main agent loop."""
# Step 1: Get API key
api_key = create_api_key()
# Step 2: Create wallet
wallet = create_wallet(api_key)
# Step 3: Securely store the private key
store_secret(api_key, "wallet_pk", wallet.get("privateKey", ""))
print("Private key stored in secrets vault")
# Step 4: Monitor prices and balances
print("\n--- Portfolio Agent Running ---")
prices = get_prices(api_key)
print(f"\nMarket prices:")
for symbol, data in prices.get("prices", {}).items():
price = data if isinstance(data, (int, float)) else data.get("price", data)
print(f" {symbol}: ${price}")
# Check wallet balance
balances = get_balance(api_key, wallet["address"])
print(f"\nWallet {wallet['address'][:10]}... balances:")
print(json.dumps(balances, indent=2))
# Check remaining credits
headers = {"Authorization": f"Bearer {api_key}"}
usage = requests.get(f"{BASE}/api/usage", headers=headers).json()
print(f"\nCredits remaining: {usage.get('credits_remaining', 'N/A')}")
if __name__ == "__main__":
run_agent()
Node.js version
const BASE = "https://agent-gateway-kappa.vercel.app";
async function main() {
// 1. Get API key
const keyRes = await fetch(`${BASE}/api/keys/create`, { method: "POST" });
const { api_key } = await keyRes.json();
const headers = { "Authorization": `Bearer ${api_key}` };
// 2. Create wallet
const walletRes = await fetch(`${BASE}/v1/agent-wallet/wallets/generate`, {
method: "POST", headers
});
const wallet = await walletRes.json();
console.log("Wallet:", wallet.address);
// 3. Store private key securely
await fetch(`${BASE}/v1/agent-secrets/api/secrets`, {
method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ key: "wallet_pk", value: wallet.privateKey })
});
// 4. Get prices
const priceRes = await fetch(`${BASE}/v1/crypto-feeds/api/prices`, { headers });
const prices = await priceRes.json();
console.log("Prices:", prices);
// 5. Check balance
const balRes = await fetch(
`${BASE}/v1/agent-wallet/wallets/${wallet.address}/balance/all`,
{ headers }
);
console.log("Balances:", await balRes.json());
}
main();
8 Next steps
You've just built an AI agent with its own crypto wallet. Here's what else you can do with Agent Gateway:
- Execute swaps — Use
/v1/agent-wallet/swap/quoteand/v1/agent-wallet/swapto trade tokens across chains - Store agent memory —
/v1/agent-memoryprovides key-value storage and vector search for agent state - Run code in sandbox —
/v1/agent-coderunnerexecutes Python, Node.js, or Bash in isolated containers - Schedule tasks —
/v1/agent-schedulerruns cron-style scheduled jobs for your agent - On-chain analytics —
/v1/onchain-analyticsfor trending tokens, whale movements, and chain stats - LLM routing —
/v1/agent-llmunifies OpenAI, Anthropic, and Groq APIs under one endpoint
All 39 services are available through the same API key. Browse the full catalog to see what's available.
/.well-known/agent.json or /llms.txt. These follow the emerging agent protocol standards.
Start building in 30 seconds
200 free credits. No email. No credit card. One API key for 39 services.
Get Started Guide Browse All APIs