Observed since 20 Oct, 22:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Know what your AI agents actually cost. Track LLM tokens, tool API calls, and compute costs.
Know what your AI agents actually cost. Track LLM tokens, tool API calls, and compute costs — per agent, per task, per tool.
pip install agentcost
agentcost login
agentcost run my_agent.py
That's it. Every OpenAI and Anthropic call inside your script is automatically tracked — zero code changes needed.
agentcost run wraps your script, detects installed LLM libraries, and captures token usage from every API response. Events are sent to your dashboard in the background. No slowdown, no side effects.
pip install agentcost
agentcost login
Stores your API key securely in ~/.config/agentcost/. Get your key from agentmeter.com.
agentcost run my_agent.py
Works with any Python script that uses OpenAI or Anthropic SDKs.
agentcost login # Save your API key (one-time setup)
agentcost run app.py # Track a script automatically
agentcost status # Check login status and connection
agentcost summary # View cost summary in terminal
agentcost agents # List all tracked agents
agentcost logout # Remove stored credentials
For more control, use the Python API directly:
import agentcost
# Auto-patch all LLM calls (after login, no key needed)
agentcost.init(agent_id="my-agent")
# Or with explicit key
agentcost.init(api_key="ac_xxxxx", agent_id="my-agent")
from agentcost import AgentCost
ac = AgentCost()
@ac.track_tool(name="stripe_api", cost_per_call=0.02)
def charge_customer(amount):
return stripe.charges.create(amount=amount)
with ac.track_run("support-agent", task="process_refund") as run:
run.record("stripe_api", cost=0.02)
run.record_llm("gpt-4o", tokens_in=500, tokens_out=200)
print(f"Run cost: ${run.total_cost:.4f}")
ac = AgentCost(
pricing_overrides={
"my_custom_api": 0.05,
"my-fine-tuned-model": {"input": 5.00, "output": 15.00},
}
)
Ships with built-in pricing for all models. Override any price with pricing_overrides.
View cost dashboards, set budgets, and get alerts at agentmeter.com.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 17 Feb 2026 | 5 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:69b83d2b22b22b29b1b3dfafbace391d7c5a3ae8f4f4fcfda1213a14f66d8810