Wallets, micro-billing, escrow, and agent-to-agent value exchange. The economic layer for autonomous agent systems.
Coming Soon โ This service is in development. Join the waitlist to get early access when it launches.
Base URL: https://api.agenttool.dev ยท All endpoints require Authorization: Bearer YOUR_API_KEY
Create a new agent wallet. Each agent can have one wallet, which holds credits for spending on services or transferring to other agents.
๐ Bearer token required| Field | Type | Required | Description |
|---|---|---|---|
| agent_id | string | required | The agent this wallet belongs to. |
| name | string | optional | Human-readable wallet name. |
| initial_credits | number | optional | Starting balance in credits. Default: 0. |
| metadata | object | optional | Arbitrary key-value data attached to the wallet. |
curl -X POST https://api.agenttool.dev/v1/wallets \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agent-42",
"name": "Primary Wallet",
"initial_credits": 1000
}'
const wallet = await at.economy.createWallet({ agentId: "agent-42", name: "Primary Wallet", initialCredits: 1000 })
{
"id": "wal_a1b2c3d4e5f6",
"agent_id": "agent-42",
"name": "Primary Wallet",
"balance": 1000,
"currency": "credits",
"created_at": "2026-03-09T12:00:00Z"
}
Deduct credits from a wallet. Use for per-call billing, agent-to-agent payments, or service consumption. Atomic โ either the full amount is deducted or nothing (no partial spends).
๐ Bearer token required| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | Wallet ID (e.g. wal_a1b2c3d4e5f6). |
| Field | Type | Required | Description |
|---|---|---|---|
| amount | number | required | Credits to deduct. Must be positive. |
| description | string | optional | What this spend is for (shown in transaction history). |
| recipient_wallet_id | string | optional | If set, credits are transferred to this wallet (agent-to-agent payment). |
| idempotency_key | string | optional | Unique key to prevent duplicate charges on retry. |
curl -X POST https://api.agenttool.dev/v1/wallets/wal_a1b2c3d4e5f6/spend \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 5,
"description": "Search API call",
"idempotency_key": "txn-20260309-001"
}'
const txn = await at.economy.spend("wal_a1b2c3d4e5f6", { amount: 5, description: "Search API call" })
{
"transaction_id": "txn_x7y8z9a0b1c2",
"wallet_id": "wal_a1b2c3d4e5f6",
"amount": 5,
"balance_after": 995,
"description": "Search API call",
"timestamp": "2026-03-09T12:05:00Z"
}
The wallet doesn't have enough credits for this spend. Check balance before spending, or top up the wallet.
Create an escrow for conditional payment. Credits are held until a condition is met (task completion, verification, timeout). Ideal for agent-to-agent work agreements.
๐ Bearer token required| Field | Type | Required | Description |
|---|---|---|---|
| payer_wallet_id | string | required | Wallet to hold credits from. |
| payee_wallet_id | string | required | Wallet to release credits to on completion. |
| amount | number | required | Credits to hold in escrow. |
| condition | string | required | Condition for release: "verification", "manual", or "timeout". |
| verification_id | string | optional | If condition is "verification", the verification ID that triggers release. |
| timeout_seconds | integer | optional | Auto-release after N seconds. Also used as deadline for condition-based escrows. |
| description | string | optional | Description of the escrow agreement. |
curl -X POST https://api.agenttool.dev/v1/escrows \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"payer_wallet_id": "wal_a1b2c3d4e5f6",
"payee_wallet_id": "wal_x7y8z9a0b1c2",
"amount": 50,
"condition": "verification",
"verification_id": "vrf_a1b2c3d4e5f6",
"timeout_seconds": 3600,
"description": "Payment for report generation task"
}'
const escrow = await at.economy.createEscrow({ payerWalletId: "wal_a1b2c3d4e5f6", payeeWalletId: "wal_x7y8z9a0b1c2", amount: 50, condition: "verification", verificationId: "vrf_a1b2c3d4e5f6", timeoutSeconds: 3600 })
{
"escrow_id": "esc_m3n4o5p6q7r8",
"payer_wallet_id": "wal_a1b2c3d4e5f6",
"payee_wallet_id": "wal_x7y8z9a0b1c2",
"amount": 50,
"condition": "verification",
"status": "held",
"expires_at": "2026-03-09T13:00:00Z",
"created_at": "2026-03-09T12:00:00Z"
}
Verify + Economy: Combine these two services for trustless agent work. Agent A creates an escrow โ Agent B does the work โ Agent B creates a verification โ Escrow auto-releases payment. No human needed.
The economy API supports three payment patterns:
Deduct credits for API usage or service consumption. Instant, atomic, idempotent.
Use recipient_wallet_id in the spend endpoint to transfer credits between agents. Instant settlement.
Hold credits until a condition is met. Combine with agent-verify for trustless, automated payments.
// 1. Agent A creates escrow for the task const escrow = await at.economy.createEscrow({ payerWalletId: agentA.walletId, payeeWalletId: agentB.walletId, amount: 50, condition: "verification" }) // 2. Agent B does the work... // 3. Agent B creates a verification proof const proof = await at.verify.attest({ action: "report_generated", agentId: agentB.id, payload: { escrowId: escrow.escrow_id, report: "..." } }) // 4. Escrow auto-releases when verification is confirmed // โ 50 credits move from Agent A โ Agent B
Missing or invalid API key.
The wallet doesn't have enough credits for the spend or escrow. Top up the wallet first.
Wallet or escrow ID doesn't exist. Check the ID format (should start with wal_ or esc_).
Duplicate idempotency_key โ this transaction was already processed. This is intentional; your request was safely deduplicated.
Request body is invalid. Common causes: negative amount, missing payer_wallet_id or payee_wallet_id on escrow.