agentledgerExpense tracking and accounting for AI agents. Log purchases, set budgets, generate spending reports, and manage multi-currency finances ā all stored locally. Privacy.com card import, natural language queries, CSV/JSON export. Use when agents make purchases and need a financial audit trail.
Install via ClawdBot CLI:
clawdbot install c-goro/agentledgerAgentLedger is an accounting skill that logs every transaction you make, tracks spending across multiple accounts, and provides detailed reports. Use this to maintain a complete financial record of your purchases.
Important: Always log transactions immediately after making purchases. This skill is designed for AI agents to track their own expenses (API costs, tool subscriptions, etc.).
When you make any purchase, immediately log it:
// In Node.js context, require the ledger
const AgentLedger = require('./src/ledger.js');
const ledger = new AgentLedger();
// Log a transaction
await ledger.logTransaction({
amount: 29.99,
currency: 'USD',
vendor: 'OpenAI',
description: 'GPT-4 API credits',
category: 'API/Services',
account: 'privacy-card-1',
context: 'Needed additional tokens for user project analysis',
receiptUrl: 'https://platform.openai.com/receipts/xyz',
confirmationId: 'sub_1234567890'
});
CLI Usage (supports both positional and named parameters):
# Positional style
node src/cli.js log 29.99 "OpenAI" "GPT-4 API credits" --category="API/Services"
# Named parameter style
node src/cli.js log --amount=29.99 --vendor="OpenAI" --description="GPT-4 API credits" --category="API/Services" --context="Monthly API refill"
// Get spending summary
const summary = await ledger.getSummary('this-month');
console.log(`Total spent this month: ${summary.total}`);
// Check specific category
const apiSpending = await ledger.getCategorySpending('API/Services', 'this-month');
// Monthly report
const report = await ledger.generateReport('monthly', { month: '2024-01' });
// Custom date range
const customReport = await ledger.generateReport('custom', {
startDate: '2024-01-01',
endDate: '2024-01-31'
});
// Set monthly budget for API services
await ledger.setBudget('API/Services', 500, 'monthly');
// Check budget status
const budgetStatus = await ledger.checkBudget('API/Services');
if (budgetStatus.isNearLimit) {
console.log(`Warning: ${budgetStatus.percentUsed}% of API budget used`);
}
Use these predefined categories for consistent tracking:
The ledger automatically detects Privacy.com card data if available:
// If you have Privacy.com JSON exports in workspace/privacy/
await ledger.importPrivacyTransactions('./privacy/card-1.json');
// Register a new payment method
await ledger.addAccount({
id: 'stripe-main',
name: 'Main Stripe Account',
type: 'credit_card',
currency: 'USD'
});
Ask questions like:
The CLI handles these queries:
node src/cli.js query "API spending this month"
node src/cli.js find "OpenAI" --last-week
Supported natural language time periods:
today, yesterdaythis-week, last-weekthis-month, last-monththis-quarter, last-quarterthis-year, last-yearlast-30-days, last-90-days// Export to CSV
await ledger.exportTransactions('csv', './exports/transactions.csv');
// Export to JSON
await ledger.exportTransactions('json', './exports/transactions.json');
# Initialize (run once)
node src/cli.js init
# Log transactions (supports both styles)
node src/cli.js log 29.99 "OpenAI" "API credits" --category="API/Services"
node src/cli.js log --amount=29.99 --vendor="OpenAI" --description="API credits" --category="API/Services"
# Check current spending
node src/cli.js summary # This month
node src/cli.js summary --period="today" # Today only
node src/cli.js summary --period="this-week" # This week
# Set and check budgets
node src/cli.js budget set "API/Services" 500 # Set monthly budget
node src/cli.js budget status # Check all budgets
# Generate detailed reports
node src/cli.js report monthly
node src/cli.js report --type=category
node src/cli.js report --type=vendor
# Search transactions
node src/cli.js find "OpenAI" # Search by vendor
node src/cli.js find "API" --category="API/Services" # Search by category
node src/cli.js find --min-amount=50 # Find large expenses
# Export data
node src/cli.js export csv # Export to CSV
node src/cli.js export --format=json # Export to JSON
# Natural language queries
node src/cli.js query "How much did I spend on APIs this month?"
node src/cli.js query "What was that $25 charge?"
# Import from Privacy.com
node src/cli.js import privacy ./privacy-export.json
workspace/ledger/transactions.jsonworkspace/ledger/accounts.jsonworkspace/ledger/budgets.jsonworkspace/ledger/settings.jsonThe ledger handles common errors gracefully:
.backup files# If you see "Could not load transactions" message:
# The system automatically tries to recover from backup
# Your data should be restored automatically
# Manual backup check
ls workspace/ledger/*.backup # Check if backups exist
workspace/ledger/ JSON filesprivacy-card-1 or company-amexGenerated Mar 1, 2026
A freelance AI developer uses AgentLedger to track API costs from OpenAI, Anthropic, and other services across multiple client projects. They log each transaction immediately after purchasing credits, categorize by project, and generate monthly reports to invoice clients accurately and maintain a clear audit trail for tax purposes.
A small SaaS startup employs AgentLedger to monitor spending on cloud infrastructure, marketing tools, and software subscriptions. The team sets monthly budgets for categories like API/Services and Infrastructure, uses natural language queries to check budget status, and exports data quarterly for financial planning and investor updates.
A digital marketing agency utilizes AgentLedger to track expenses on ad platforms, social media tools, and analytics services for various client campaigns. They log transactions with vendor details, use the CLI to generate category-based reports, and import data from Privacy.com cards to reconcile spending against campaign budgets efficiently.
A university research lab implements AgentLedger to log and analyze costs associated with AI model APIs and computational resources for academic projects. Researchers log each transaction with context notes, check spending summaries weekly to avoid overages, and export JSON data for grant reporting and funding accountability.
An e-commerce business uses AgentLedger to manage recurring subscriptions for tools like inventory management, customer support, and analytics platforms. They set budgets for the Subscriptions category, use natural language queries to identify charges, and generate monthly reports to optimize costs and ensure financial transparency.
Offer a free basic version for individual AI agents to track transactions and generate simple reports. Charge a monthly subscription for advanced features like multi-currency support, team collaboration, automated Privacy.com imports, and detailed analytics dashboards, targeting small businesses and teams.
Sell annual licenses to larger companies needing expense tracking across multiple departments or projects. Include custom integrations, enhanced security, priority support, and API access for embedding into existing financial systems, with pricing based on the number of users or transactions.
Integrate AgentLedger with AI tool marketplaces or platforms where agents make purchases. Earn a small commission on each transaction logged through the skill, while providing value-added financial tracking to users and partners, creating a passive revenue stream from ecosystem activity.
š¬ Integration Tip
Integrate AgentLedger by running the CLI init command first, then automate transaction logging in your AI agent's code immediately after purchases to ensure accurate, real-time expense tracking without manual intervention.
Query Copilot Money personal finance data (accounts, transactions, net worth, holdings, asset allocation) and refresh bank connections. Use when the user asks about finances, account balances, recent transactions, net worth, investment allocation, or wants to sync/refresh bank data.
Stripe API integration with managed OAuth. Manage customers, subscriptions, invoices, products, prices, and payments. Use this skill when users want to process payments, manage billing, or handle subscriptions with Stripe. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Requires network access and valid Maton API key.
QuickBooks API integration with managed OAuth. Manage customers, invoices, payments, bills, and run financial reports. Use this skill when users want to interact with QuickBooks accounting data. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Advanced financial calculator with future value tables, present value, discount calculations, markup pricing, and compound interest. Use when calculating investment growth, pricing strategies, loan values, discounts, or comparing financial scenarios across different rates and time periods. Includes both CLI and interactive web UI.
Track expenses via natural language, get spending summaries, set budgets
Query and manage personal finances via the official Actual Budget Node.js API. Use for budget queries, transaction imports/exports, account management, categorization, rules, schedules, and bank sync with self-hosted Actual Budget instances.