Tracks every major provider — 3,500+ models supported

OpenAI
Anthropic
Google
Mistral
DeepSeek
Groq
Cohere
Together AI
AWS Bedrock
Azure OpenAI
Perplexity
Replicate
Fireworks AI
Meta Llama
OpenAI
Anthropic
Google
Mistral
DeepSeek
Groq
Cohere
Together AI
AWS Bedrock
Azure OpenAI
Perplexity
Replicate
Fireworks AI
Meta Llama

Capabilities

Your invoice says what you spent.
It never says what you spent it on.

Nine things AgentCost tells you that a token total cannot — for what already ran, and for what you are about to ship.

support-triage$0.0338 per run
classify$0.0008
search_docs$0.0209
2.4× per run · loop
draft_reply$0.0121
01 · Cost per run

What one run actually cost — per step, per tool, with loops flagged.

How it works

From call to insight
in four steps.

pip install agentcost

Install the SDK

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.

step-01.sh
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

Two lines. That's it.

No wrappers, no decorators, no middleware. AgentCost uses lightweight interception to instrument OpenAI, Anthropic, Gemini, and LangChain calls transparently. Your code stays clean.

01

Install the SDK

pip install agentcost

02

Add two lines

import + init — done

03

See your costs

Open your dashboard at agentcost.tech

my_agent.py
from agentcost import track_costs
 
# Settings → your project → copy UUID + API key
track_costs.init(api_key="sk_...", project_id="6b3f2e1d-9c4a-4f8e-b2d7-3a5c8e9f0a1b")
 
# Your existing code works unchanged
from langchain_openai import ChatOpenAI
 
llm = ChatOpenAI(model="gpt-4o")
response = llm.invoke("Analyze this data...")
# ↑ Automatically tracked: tokens, cost, latency
0+models trackedOpenAI · Anthropic · Google · Mistral · and 50+ providers
~0msblocking overheadEvents are batched and sent asynchronously — tracking never blocks your calls
0%open source (MIT)Free hosted cloud — or self-host the same stack with Docker. No lock-in.

Privacy

Built to know what your agents cost.
Never what they said.

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.

Verifiable, not promised
The wire payload is documented field by field, and each field links to the open-source SDK line that builds it.
Hashed, not stored
Duplicate detection uses a SHA-256 digest computed locally from the prompt. Only the one-way digest leaves your process.
Self-host for zero exposure
The same MIT-licensed stack runs on your infrastructure with Docker. Nothing leaves your environment — no telemetry, no phone-home.
One call, end to endmeasuring
  1. Your prompt1,284 tokens · counted locally

    Stays in your process. Never on the wire.

  2. sha256(prompt)one way

  3. EventPOST /v1/events/batch
    agent_namemodeltokenscostlatency_msinput_hash

What leaves your process

Metadata only13 fieldsTap a field
What is never sent

FAQ

Frequently asked questions

Getting Started

Technical

Pricing & License

Weighing up alternatives? Honest side-by-side breakdowns:

Have another question? Read the docs · Open a GitHub issue

Stop guessing.
Start tracking.

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