Wallgent

Quickstart

Get an API key, create a wallet, and send a payment in under five minutes.

Create a Wallgent account, grab an API key, and have your first AI agent wallet running in under five minutes.

Create your account

Go to dashboard.wallgent.com and sign up. No credit card required for the sandbox.

Get an API key

In the dashboard, navigate to API Keys and create a new key. Copy it — it's shown once.

Your key looks like: wg_test_... (sandbox) or wg_live_... (production).

Install the SDK

npm install @wallgent/sdk
# or
pnpm add @wallgent/sdk

Create a wallet

Every AI agent gets its own programmable wallet backed by a double-entry ledger.

import { Wallgent } from '@wallgent/sdk';

const wg = new Wallgent('wg_test_your_key_here');

const wallet = await wg.wallets.create({
  name: 'Research Agent',
  agentName: 'research-bot',
});

console.log(wallet.id); // wal_01J...

Add a spending policy

The policy engine is fail-closed — any rule violation or error denies the transaction.

await wg.policies.create(wallet.id, {
  name: 'Spending Guard',
  maxTransactionAmount: '25.00',   // MAX_AMOUNT: deny anything over $25
  dailySpendingLimit: '50.00',     // DAILY_LIMIT: deny once agent hits $50/day
});

Available policy rules: MAX_AMOUNT, DAILY_LIMIT, MONTHLY_LIMIT, VENDOR_ALLOWLIST, TIME_RESTRICTIONS, HUMAN_IN_THE_LOOP

Fund the wallet and send a payment

// Fund the wallet (sandbox funds are virtual)
await wg.wallets.fund(wallet.id, { amount: '100.00' });

// Send a payment — evaluated against all active policies before posting
const payment = await wg.payments.send({
  fromWalletId: wallet.id,
  toWalletId: 'wal_recipient_id',
  amount: '10.00',
  description: 'API subscription fee',
});

console.log(payment.id);    // txn_01J...
console.log(payment.state); // "POSTED"

The 0.5% fee (minimum $0.25) is deducted automatically. Amounts are stored as decimal(20,8) — never floating point.

What just happened

Your agent wallet has a double-entry accounting ledger behind it. Every transaction creates immutable ledger entries — you can't delete or modify them. The policy engine evaluated MAX_AMOUNT and DAILY_LIMIT before the payment posted. If either had triggered, the payment would have returned POLICY_DENIED.

Next steps

On this page