Skip to main content
Glama

AgentBill — Local-First AI Billing Forensics, Auto-Fix & Agency PDF Invoicing (MIT)

Live Local-First Web Workstation (Zero Server Upload): https://ttthkim-hue.github.io/agentbill/ License: 100% Free, Non-Commercial MIT Open-Source (LICENSE)

AgentBill is an offline, zero-server-upload toolkit (Installable CLI + Stdio MCP Server + Local-First Web Workstation) for developers, startups, and AI automation agencies. Drop raw OpenAI, Anthropic, Google Gemini, or AWS Bedrock CSV / JSON / JSONL / PDF billing statements to:

  1. Forensically Isolate Runaway Spend Spikes — Robust Modified Z-Score (MAD) anomaly detection + token rate-card reconciliation across 25+ major models without needing a proxy installed beforehand.

  2. Generate Vector Dispute Evidence Pack PDFs — 1-click multi-page vector PDF (pdf-lib) containing an embedded daily spend anomaly chart, isolated incident table, rate-card delta reconciliation, and a ready-to-submit provider billing support ticket letter.

  3. Generate Drop-In Preventive Auto-Fix Code — Calibrated directly to your normal daily baseline: agentbill-guard.ts (hourly USD circuit-breaker & smart model router), litellm-guard.yaml, and an importable n8n-circuit-breaker.json Code Node.

  4. Split Multi-Client Agency Usage into Client-Ready PDF Invoices — Automatically group spend by client/project/api_key, apply custom markup %, monthly retainer, tax, and currency (USD/KRW/EUR), hide or show raw API costs, and batch-export vector client invoice PDFs.

Quick Start (CLI)

npm install
npm run build:cli

# 1. Audit any CSV, JSON, JSONL, or PDF billing statement & export Dispute PDF + drop-in fix configs
node bin/agentbill.mjs audit ./openai-usage.csv \
  --dispute-pdf ./dispute-pack.pdf \
  --fix-dir ./fixes

# 2. Split agency CSV across clients & generate individual vector Invoice PDFs
node bin/agentbill.mjs invoice ./agency-nov.csv \
  --margin 100 --retainer 250 --out-dir ./invoices

# 3. CI/CD budget anomaly gate (exits code 2 if anomaly detected)
node bin/agentbill.mjs audit ./daily-usage.csv --fail-on-anomaly --json

Related MCP server: AWS FinOps MCP Server

MCP Server (Claude Code · Cursor · Antigravity · Codex)

{
  "mcpServers": {
    "agentbill": {
      "command": "node",
      "args": ["path/to/agentbill/bin/agentbill.mjs", "mcp"]
    }
  }
}

Exposed MCP tools:

  • agentbill_audit_file

  • agentbill_generate_dispute_pdf

  • agentbill_generate_client_invoices

  • agentbill_generate_fix_configs

Non-Commercial MIT Open-Source Notice

AgentBill is 100% free, MIT-licensed open-source software with zero telemetry, zero server uploads, zero payment walls, and zero ads.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents and finance teams to extract structured fields from messy invoices and audit them before payment, applying seven evidence-backed risk rules that catch total/tax mismatches, duplicate invoices, missing fields, future dates, and round amounts, then returning a 0–100 score with a payment link. Exposes four MCP tools over stdio and Streamable HTTP (spec 2025-11-25) plus a web UI, backed by an optional AWS Bedrock or OpenAI-compatible extraction brain that degrades gracefully to a zero-dependency offline engine.
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to analyze cloud spending by tags, time ranges, and service groupings, audit for waste such as stopped EC2 instances, unattached EBS volumes, and unassociated Elastic IPs, and check budget status across multiple accounts and regions using natural language, while keeping credentials securely on the local machine.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables local AI agents to audit local statement exports for recurring subscriptions, silent price hikes, duplicate charges, and annual renewal traps without cloud uploads. It also exposes tools for demo audits, cancellation notice generation, and service listing.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      100% local-first, zero-dependency stdio MCP server, CLI & VS Code/Cursor extension that parses local Claude Code, Codex CLI, Gemini CLI, Cline & Roo Code logs, maps token spend to Git repos, and generates client pass-through PDF & Xero/QuickBooks invoices.
      4
      MIT