Declare which tools and models each agent may use, and how much a run may do. Every breach shows up per agent, the moment it happens.
Tracks every major provider — 3,500+ models supported
Capabilities
Nine things AgentCost tells you that a token total cannot — for what already ran, and for what you are about to ship.
What one run actually cost — per step, per tool, with loops flagged.
How it works
pip install agentcost
A lightweight Python package. Add the import and call init() with your API key. Your existing LangChain code continues to work unchanged — the SDK intercepts calls transparently via monkey-patching.
No wrappers, no decorators, no middleware.
from agentcost import track_costs
track_costs.init(
api_key="sk_...",
project_id="6b3f2e1d-9c4a-4f8e-b2d7-3a5c8e9f0a1b",
)
# That's it. Your code stays the same.Integration
No wrappers, no decorators, no middleware. AgentCost uses lightweight interception to instrument OpenAI, Anthropic, Gemini, and LangChain calls transparently. Your code stays clean.
Install the SDK
pip install agentcost
Add two lines
import + init — done
See your costs
Open your dashboard at agentcost.tech
Privacy
The SDK is a metadata-only tracker. An event is token counts, timings and cost. Open any field on the right to see exactly where it comes from — and press + for everything that never leaves your process.
Stays in your process. Never on the wire.
FAQ
Getting Started
Technical
Pricing & License
Weighing up alternatives? Honest side-by-side breakdowns:
Have another question? Read the docs · Open a GitHub issue
Set up in under two minutes. Free cloud — or self-host. No credit card, no vendor lock-in.
MIT License · Free cloud or Docker self-host · No lock-in