Getting Started
Self-Registration
Agent-first registration flow. An AI agent registers itself and gets an API key, wallet, and claim code -- no human intervention required.
Self-Registration
aibank uses an agent-first registration model. The agent registers itself via a single API call and immediately receives everything it needs to operate: an API key, a multi-chain wallet, and a claim code for human verification.
How it works
- Agent calls
POST /v1/agents/register(no auth required) - Server returns API key, wallet addresses, and a claim code
- Agent starts operating with its new credentials
- Human (optional) visits the claim URL to verify ownership
Registration request
const response = await fetch("http://localhost:4000/v1/agents/register", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "trading-bot-1",
email: "owner@example.com",
}),
});
const data = await response.json();Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Agent name. Defaults to "unnamed-agent". |
email | string | No | Owner email. Used for claim code email lock. |
Response (201)
{
"agentId": "550e8400-e29b-41d4-a716-446655440000",
"apiKey": "ak_a1b2c3d4e5f6...",
"claimCode": "XKCD-4291",
"verificationUri": "http://localhost:4000/device?code=XKCD-4291",
"expiresIn": 315360000,
"wallet": {
"id": "wallet-uuid",
"name": "trading-bot-1",
"addresses": {
"ethereum": "0x742d35Cc...",
"base": "0x742d35Cc...",
"solana": "7vYr3e..."
}
}
}What you get
| Component | Description |
|---|---|
| API Key | ak_ prefixed key. Use in X-API-Key header for all authenticated requests. |
| Wallet | Multi-chain wallet with addresses on Ethereum, Base, and Solana. Same EVM address across all EVM chains. |
| Claim Code | 4-letter + 4-digit code (e.g. XKCD-4291). Human uses this to claim ownership. |
| Spending Controls | Default limits applied: $100/day, $500/week, $1000/month, $50/transaction. |
| Credits | $10.00 USD starting balance for gateway API calls. |
Claim flow
The claim code enables a human to verify ownership of an agent without needing to be involved during registration.
1. Agent shares claim URL
http://localhost:4000/device?code=XKCD-42912. Human visits the page
The device page shows agent details and prompts for an email address.
3. Lookup agent info (optional)
curl "http://localhost:4000/v1/device/info?code=XKCD-4291"Returns:
{
"agentId": "550e8400-e29b-41d4-a716-446655440000",
"agentName": "trading-bot-1",
"emailRequired": true,
"expiresAt": "2036-03-20T00:00:00.000Z"
}4. Submit claim
curl -X POST http://localhost:4000/v1/device/claim \
-H "Content-Type: application/json" \
-d '{"code": "XKCD-4291", "email": "owner@example.com"}'Returns the full agent details including the API key.
Using with the SDK
// Agent self-registers via raw HTTP (no SDK needed for registration)
const res = await fetch("http://localhost:4000/v1/agents/register", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name: "my-agent" }),
});
const { apiKey, wallet } = await res.json();
// Now use the SDK with the returned key
import { Aibank } from "aibank";
const aibank = new Aibank({
apiKey,
walletBaseUrl: "http://localhost:4000",
});
const myWallet = aibank.getWallet(wallet.id);
const balances = await myWallet.getBalances();