AgentCost gives engineering teams real-time cost visibility, automatic budget controls, and intelligent model routing. One line of code. Zero config.
pip install agentcostin
click to copy
from agentcost.sdk import trace from openai import OpenAI # One line. Every call tracked. client = trace(OpenAI(), project="my-app") response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello!"}] ) # Cost, tokens, latency — recorded automatically.
The Problem
Teams deploy agents across multiple providers with no centralized view of spend, no budget controls, and no way to know if cheaper models would work.
Developers pick models by habit, not cost. GPT-4o for classification tasks that GPT-4o-mini handles.
+$2,400/mo wastedUsage grows 3x in a sprint and nobody notices until the cloud bill arrives. No forecasting, no warnings.
$47K instead of $15KCFO asks "what did we spend on the chatbot?" and engineering has no answer. No breakdown by team or goal.
??? per projectThe Dashboard
Seven intelligence views — from real-time spend to 30-day forecasts to model optimization.
Features
AgentCost prevents overruns, routes to cheaper models, and blocks wasteful calls — before they happen.
Auto-classify prompts by complexity. Simple questions route to economy models, reasoning to premium. Saves 30-60%.
complexity_router.pyPre-execution checks: ALLOW <80%, WARN at 80%, auto-DOWNGRADE at 90%, BLOCK at 100%. Overruns become impossible.
budget_gate.pyPredict next 7/14/30 days using ensemble methods. "At current rates, your $5K budget runs out March 22nd."
forecast/Scores 0-100 for each project. Detects waste: excessive system prompts, under-used context, low output ratios.
token_analyzer.pyTag calls to business objectives. "How much did Feature X cost?" Hierarchical rollup: task → sprint → OKR.
goals/Event-driven automation: budget exceeded → Slack + suspend agent + escalate. No code needed.
reactions/defaults.yamlNotifier, Policy, Exporter, Provider, Tracker, Reactor, Runtime, Agent — every point is swappable.
agentcost plugin createOne-click: Startup ($500/mo), Enterprise (5 cost centers), SOC 2 (audit trail, no free tier).
templates/Setup
One dependency. No infrastructure. No signup.
pip install agentcostin
One function call. Zero changes to application code.
client = trace(OpenAI(), project="my-app")
Costs, forecasts, and optimization recommendations — instantly.
agentcost dashboard
Integrations
Pricing
Free forever for developers and small teams.
Everything you need to track and optimize AI costs.
Governance and compliance for organizations.
Your next AI invoice doesn't have to be a surprise.