Skip to main content

Virtual Cards

Anima lets you issue virtual debit cards directly to AI agents. Each card carries its own spending limits, merchant restrictions, and optional pre-approval rules, so your agents can make autonomous purchases without requiring per-transaction human review.
Production card issuing requires completed KYB approval. See KYB Onboarding to start verification before issuing cards.

Issue a card

1

Install the SDK

npm install @anima-labs/sdk
2

Create an agent and issue a card

import { Anima } from "@anima-labs/sdk";

const anima = new Anima({ apiKey: "ak_..." });

// Create an agent
const agent = await anima.agents.create({ name: "Shopping Agent" });

// Issue a virtual card
const card = await anima.cards.create({
  agentId: agent.id,
  label: "Daily Shopping",
  currency: "usd",
  spendLimitDaily: 10000,      // $100.00 in cents
  spendLimitPerAuth: 5000,     // $50.00 per transaction
  allowedMerchantCategories: ["5411", "5412"],
});

console.log(`Card: **** ${card.last4}`);
console.log(`Daily limit: $${(card.spendLimitDaily / 100).toFixed(2)}`);

List cards

const cards = await anima.cards.list({ agentId: agent.id });

for (const card of cards.data) {
  console.log(`${card.label}: **** ${card.last4}${card.status}`);
}

Freeze and unfreeze a card

Freeze a card to pause all authorizations without deleting it. Unfreeze to resume spending.
// Freeze
await anima.cards.freeze({ cardId: card.id });

// Unfreeze
await anima.cards.unfreeze({ cardId: card.id });

Check balance

const balance = await anima.cards.getBalance(card.id);

console.log(`Available: $${(balance.availableCents / 100).toFixed(2)}`);
console.log(`Spent today: $${(balance.spentTodayCents / 100).toFixed(2)}`);

Card parameters

agentId
string
required
The ID of the agent that owns this card.
label
string
required
A human-readable name for the card, such as "Research Card" or "Travel Expenses".
currency
string
required
ISO 4217 currency code. Use "usd" for US dollars.
spendLimitDaily
number
Maximum total spend per calendar day, in cents.
spendLimitPerAuth
number
Maximum amount per individual transaction, in cents.
allowedMerchantCategories
string[]
List of MCC codes the card is permitted to transact with. When set, all other categories are blocked.

Next steps

  • Card Controls — Set per-transaction limits, MCC rules, velocity controls, and pre-approval logic
  • KYB Onboarding — Complete business verification required for production card issuing
  • Agent Wallet — Budget management and x402 payments