Catalog PyPI
PACKAGE EXPLORERView in registry

ai-agent-spend-guardian

PyPI

Real-time cost monitoring for AI agent deployments across LLM providers

Versions collected1
Direct dependencies18From release 0.1.0
Last observed21 Oct, 09:54 UTC

README

Version 0.1.0 documentation

AI Agent Spend Guardian

Real-time cost monitoring and budget controls for autonomous AI agent deployments.

What is this?

AI Agent Spend Guardian is a cost tracking and monitoring dashboard built for teams running AI agents across platforms like n8n, Composio, LangChain, and AutoGPT. It aggregates LLM API expenses across OpenAI, Anthropic, and local model providers in one unified interface, solving the critical blind spot where teams deploy autonomous agents with zero cost visibility and no budget safeguards.

Features

  • Multi-provider cost tracking — Monitor spending across OpenAI, Anthropic, Ollama, Groq, Together AI, and other LLM providers
  • Real-time dashboards — Web UI and CLI tools for instant cost visibility
  • Budget controls — Set spending limits per agent, workflow, or team with automated alerts
  • Agent-aware insights — Track costs by individual agent, workflow execution, or time period
  • Alerting — Slack and Discord webhooks for budget breach notifications
  • Export & reporting — CSV exports for finance teams and compliance audits
  • Provider-agnostic — Works with any LLM API, including self-hosted and local models
  • Offline support — CLI tool parses local API logs and env files without external connectivity

Quick Start

Installation

pip install -r requirements.txt

Configuration

Copy .env.example to .env and add your API credentials:

cp .env.example .env

Edit .env with your provider keys:

OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
DATABASE_URL=postgresql://user:password@localhost/agent_spend_guardian

Run the Application

Start the FastAPI server:

python -m agent_spend_guardian.main

The dashboard will be available at http://localhost:8000.

CLI Usage

Generate a cost report from local logs:

python -m agent_spend_guardian.cli report --days 7 --format csv

Set a budget alert:

python -m agent_spend_guardian.cli budget set --agent my-agent --limit 100.00

Usage Examples

Web Dashboard

Access the dashboard to:

  • View real-time spending across all agents
  • Set budget limits and thresholds
  • Inspect cost breakdowns by provider, model, and agent
  • Export reports for finance review

API Integration

from agent_spend_guardian.tracker import SpendTracker

tracker = SpendTracker()

# Log an API call
tracker.log_call(
    agent_id="my-agent",
    provider="openai",
    model="gpt-4",
    tokens_used=1500,
    cost=0.045
)

# Retrieve costs
costs = tracker.get_agent_costs("my-agent", days=7)
print(f"7-day spend: ${costs['total']}")

Budget Alerts

Configure Slack notifications:

python -m agent_spend_guardian.cli alert configure \
  --channel #costs \
  --webhook https://hooks.slack.com/services/YOUR/WEBHOOK

Tech Stack

  • Backend: Python 3.10+, FastAPI
  • Database: PostgreSQL (production), SQLite (local CLI)
  • ORM: SQLAlchemy with Alembic migrations
  • Frontend: React (dashboard)
  • Authentication: JWT-based auth
  • Deployment: Docker-ready

Development

Database Migrations

alembic upgrade head

Contributing

See CONTRIBUTING.md for guidelines on submitting issues and pull requests.

Monetization

Freemium SaaS model with free tier, Pro ($39/mo), and Enterprise ($299/mo) plans. See MONETIZATION.md for details.

License

MIT License — see LICENSE for details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.02 May 202618

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:54 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:5cc423435c65881b8f5a601476f66076c3e5b8e5643d77cab3f66768287a65bf