# AgentCost — full content > AgentCost is an open-source LLM cost observability platform. It records every OpenAI, Anthropic, Gemini and LangChain call an application makes and attributes the cost to the agent, workflow and project that caused it. Free hosted cloud, MIT-licensed stack, and a public model-pricing API that needs no credentials. Generated from https://agentcost.tech. Index: https://agentcost.tech/llms.txt. API: https://agentcost.tech/openapi.json. # AgentCost — LLM cost tracking for agents > Track OpenAI, Anthropic, Gemini and LangChain spend in real time, attributed to the agent that caused it. Free hosted cloud, MIT-licensed stack. AgentCost records every LLM call your application makes — model, tokens, cost, latency and status — and attributes it to the agent, workflow and project that caused it. It answers the question a provider dashboard cannot: which part of my system is expensive, and what would be cheaper? ## Quick start Install the Python SDK and add two lines. Existing LangChain, OpenAI and Anthropic code runs unchanged — the SDK intercepts calls by monkey-patching the provider client, so there is no refactoring. ```bash pip install agentcost ``` ```python import agentcost agentcost.init(api_key="sk_your_project_key") ``` ## What it gives you - **Per-agent attribution** — wrap a block with `track_costs.agent("planner")` and every call inside it is billed to that agent. - **Workflow and trace analysis** — step costs, repeated work and per-run totals across multi-step agents. - **Budget guardrails** — monthly project budgets with threshold alerts, and an optional hard cap that rejects ingestion with a 429 once the budget is reached. - **Optimization recommendations** — cheaper-model suggestions and caching opportunities derived from your own traffic, with effectiveness tracked after you apply them. - **Executive reports** — a board-ready PDF or CSV over any date range. - **A public model catalogue** — 3,500+ models across 50+ providers with per-1k input, output and cached rates, synced from LiteLLM. ## Cost Free. The hosted cloud has no tiers, seat limits or usage caps, and the whole stack is MIT-licensed, so you can self-host the FastAPI backend and PostgreSQL on your own infrastructure instead. In self-hosted mode nothing leaves your environment and there is no telemetry or phone-home behaviour. ## Stack Backend: Python, FastAPI, async SQLAlchemy, PostgreSQL. Frontend: Next.js, React, Tailwind CSS. SDK: Python, using tiktoken for token counting and httpx for async delivery. --- Canonical HTML: https://agentcost.tech/ Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost Pricing > Free at every level — no tiers, no seat limits, no usage caps — plus an MIT-licensed stack you can self-host. AgentCost is free. - **Hosted cloud** — sign up and use it. No usage limits, no tiers, and no premium features behind a paywall. Events are stored at https://api.agentcost.tech, and you can delete your data or your account at any time. - **Self-hosted** — the same stack is MIT-licensed. Run the FastAPI backend and PostgreSQL with Docker on your own infrastructure. Nothing leaves your environment and there is no telemetry. There is no paid plan, and no feature is gated on payment. If you are weighing AgentCost against a paid platform, the side-by-side pages at https://agentcost.tech/compare cover Helicone, Langfuse and LiteLLM, with each vendor's pricing read off their own page on a stated date. --- Canonical HTML: https://agentcost.tech/pricing Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost Changelog > Every released version of AgentCost, newest first, with what changed in each. ## v1.11.0 — 2026-08-11 Workflow tracing, cost per completed outcome, a pre-deployment analyser, and classification-workload detection - Added workflow tracing to the SDK: wrap a multi-step run in track_costs.workflow() and its calls in step() or tool(), and every event records where it sat in that run. Works across OpenAI, Anthropic, Gemini and LangChain, including streamed calls. - New Workflows page showing cost per run rather than per call, cost per step and per tool, and a distribution chart of what a single run actually costs — with the most expensive 5% of runs and their share of spend called out, because an average hides the runs worth finding. - Repeated-work detection: identical calls made more than once inside a single run. This is distinct from the duplicate calls a cache fixes — within one run it usually means the control flow is looping. - Added cost per completed outcome. Call track_costs.outcome(success, label=...) and the dashboard reports what a result costs, charging failed runs to the successes they were paid for. Runs that report nothing are counted as unreported, never as failures. - New agentcost analyze command estimates what an agent will cost before it has spent anything: it token-counts your prompt and skill files, projects a recorded local-mode test run to production volume, and flags looping steps, repeated calls, oversized prompts and duplicated context. It runs entirely on your machine and transmits nothing — use --fail-on high to block a deploy in CI. - Optimizations now detect classification-shaped workloads: agents whose responses are always short and whose inputs repeat are doing work a smaller model, a trained classifier, or a lookup would do far more cheaply. Detected from token counts alone, without reading any prompt. - Documented the full trace and outcome payloads on the Data & Privacy Architecture page, including that workflow, step, tool and label names are strings you write and are transmitted as written. - Every workflow endpoint is documented in the API Reference, and none of this changes existing events: without a workflow() the SDK emits exactly what it did before. ## v1.10.0 — 2026-08-04 Hosted-cloud positioning, instant onboarding, OpenAI & Anthropic spend import, and corrected integration snippets - Clarified positioning across the site: AgentCost is a free hosted cloud (api.agentcost.tech + this dashboard), and the same MIT-licensed stack remains fully self-hostable — claims like 'your data never leaves your infrastructure' are now correctly scoped to the self-hosted option. - Instant onboarding: signing up now auto-creates a project with an API key, so you can go from register to tracked calls without any manual setup. - Added OpenAI 30-day spend import so new accounts see real historical spend immediately after connecting. - Corrected every integration snippet on the site: API keys use the real sk_ prefix and init() examples include the required project_id (a UUID you copy from Settings). - Fixed an analytics error on the Models page. - Unified the public model count (3,500+) across the landing page, pricing page, FAQ, docs, and metadata — it previously varied between pages. - Added a real favicon.ico (previously only an SVG icon was declared, so /favicon.ico returned 404). ## v1.9.0 — 2026-06-28 Executive Reports with PDF/CSV export, a redesigned Pricing page, and reliability fixes - Added Executive Reports — a new Reports page that pairs a one-glance executive summary (spend, calls, tokens, success rate, latency, projected run-rate, each with period-over-period deltas) with deep breakdowns: latency percentiles (p50/p95/p99), model cost concentration (Pareto), token efficiency, per-model error analysis, usage cadence (busiest day/hour), budget status, and an optimization-savings rollup. - Reports run over standard ranges, month-to-date, or a fully custom start/end date window — deltas always compare against the immediately preceding window of equal length. - Added a one-click PDF export that renders a purpose-built, letterheaded document (its own typography, KPI grid, tables, and inline SVG charts) instead of printing the dashboard — consistent output on every machine. - Added CSV export of the raw breakdown tables (models, agents, errors, cadence) with a UTF-8 byte-order mark and CRLF line endings, so currency symbols and accented text open correctly in Excel. - Backed the report with a new /v1/analytics/report endpoint and ReportService that compose the existing analytics, budget, and optimization services — no duplicated aggregation logic. - Reports work end-to-end in the no-signup demo, generated entirely client-side from the same sample dataset as the rest of the demo. - Redesigned the Pricing page: the header link now opens a dedicated page with an interactive savings estimator and an honest, single 'Free forever' open-source plan — replacing the old anchor jump to the metrics section. - Added a Back-to-home link and a featured-post layout to the Blog index. - Fixed the test suite's in-memory database setup (shared connection + commit-on-success) and aligned auth fixtures with the dual-auth model, restoring full green coverage; corrected the soft-delete test to reflect intentional grace-period reactivation. ## v1.8.0 — 2026-06-18 Interactive no-signup demo, a redesigned analytics dashboard, and broader model coverage - Added Live Demo mode — explore a fully populated workspace (sample data from a fictional AI-support company) with no signup. It runs entirely client-side, so the demo works even when the API is unavailable. - Reachable from the landing hero, the navbar, and the sign-in page, the demo is read-only: any write action invites you to create a free account, and signups originating in the demo are attributed for conversion reporting. - Added a Demo Funnel page to the admin control plane: sessions over time, entry sources, most-explored pages, signup click-through, and demo-to-account conversion rate. - Redesigned the dashboard with hero metric cards (inline sparklines and period-over-period deltas) and a new operational snapshot: projected monthly spend at the current run rate, blended cost per 1K tokens, and failed-call/error-rate tracking. - Added a new activity chart with a Spend / Calls / Tokens switcher and a period-average reference line, an interactive cost-by-model donut, and a ranked agent cost list with per-agent calls, success rate, and latency. - Reworked the Agents and Models pages with provider tags, cost-share bars, call-volume-weighted success rates, and input/output token-split visualizations. - Updated model coverage to reflect 2,900+ supported models, synced from LiteLLM's pricing database. - Refined the visual language across the app — flat, single-color data fills replace cross-color gradient treatments for a cleaner, more professional look. - Fixed a reliability issue on the registration page where an unreachable policy-versions endpoint surfaced a console error instead of silently falling back to the built-in defaults. ## v1.7.1 — 2026-05-24 INR currency support, clearer Budget Guardrails UX, and stability fixes - Added per-project currency selection for Budget Guardrails — USD and INR are supported, with live ECB-sourced FX rates fetched and cached for 6 hours via frankfurter.app. - Budget evaluation now converts USD cost events into the project's chosen currency before comparing against thresholds and the hard-cap budget, so a ₹4,000 budget behaves natively in INR. - Email and in-app budget alerts now render amounts with the project's currency symbol (₹ or $). - Redesigned the Enforcement Mode dropdown with a dark-theme custom selector and clearer wording (Tracking only / Notify on thresholds / Block when budget is reached). - Widened the threshold input so the helper text is no longer clipped. - Fixed a TypeError on /v1/auth/me caused by legacy naive timestamps in last_active_at. - Auto-migration now also adds events.cost_source and events.input_hash so analytics queries succeed on first deploy. - Logout now clears the project-scoped API key from local storage to prevent a previous account's key from leaking into a new account session. - Team page detects when a stored API key points to a project the current user can't access and offers a one-click recovery action. ## v1.7.0 — 2026-05-24 Budget Guardrails: monthly caps, threshold alerts, and notifications - Added per-project monthly budget configuration with enforcement modes: off, warn, and hard_cap. - Added configurable alert thresholds (defaults: 50%, 80%, 100%) with strict 1–100% validation and automatic deduplication. - Added deduplicated threshold crossing records via a new budget_threshold_alerts table — guaranteed at most one alert per project, per month, per threshold. - Added in-app notification system: per-user notification feed with unread counts, severity levels (info / warning / critical), mark-read, and mark-all-read endpoints. - Added budget alert email template — branded HTML email dispatched via Resend to project owners and admin members on every newly crossed threshold. - Added a notification bell to the dashboard layout with a live unread badge that polls every 60 seconds. - Added the Budget Guardrails settings card with month-to-date utilization, color-coded progress bar, and threshold chip editor. - Hardened the ingestion endpoint: returns HTTP 429 when projected spend exceeds the budget in hard_cap mode, with a clear, actionable error message. - Added 13 unit + integration tests covering threshold normalization, month-window math, year-rollover, evaluation across all enforcement modes, dedup, and owner/admin fan-out. ## v1.6.4 — 2026-03-20 Branding and SEO coverage for multi-provider support - Updated site metadata to explicitly include OpenAI and Anthropic alongside LangChain across title, description, Open Graph, and Twitter cards. - Updated landing-page copy and SDK snippets to reflect multi-provider support. - Standardized icon metadata (shortcut + apple touch icon) for consistent favicon rendering across browsers. --- Canonical HTML: https://agentcost.tech/changelog Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost Documentation > Index of every AgentCost developer resource: SDK, REST API, CLI, model catalogue, OpenAPI spec and privacy architecture. ## SDK and tooling - [AgentCost Python SDK](https://agentcost.tech/docs/sdk) — install, quick start, configuration, agent tagging, workflows, streaming, local mode. - [AgentCost CLI reference](https://agentcost.tech/docs/cli) — `agentcost analyze`, pre-deployment cost estimates, CI usage. - [AgentCost REST API reference](https://agentcost.tech/docs/api) — authentication, endpoints, error format. - [AgentCost model catalogue](https://agentcost.tech/docs/models) — every supported model with live per-token pricing. - [AgentCost data and privacy architecture](https://agentcost.tech/docs/privacy) — exactly what the SDK transmits and what it never collects. ## Machine-readable - [AgentCost OpenAPI 3.1 specification](https://agentcost.tech/openapi.json) — the full API surface. YAML at https://agentcost.tech/api/openapi.yaml. - [llms.txt](https://agentcost.tech/llms.txt) — this site, indexed for agents. - [llms-full.txt](https://agentcost.tech/llms-full.txt) — every public page as one markdown document. - Public API: https://agentcost.tech/api/v1 (cached mirror) and https://api.agentcost.tech (origin). ## Packages - PyPI: https://pypi.org/project/agentcost/ - GitHub: https://github.com/agentcost-ai --- Canonical HTML: https://agentcost.tech/docs Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost Python SDK > Install the SDK, initialise it with two lines, and every OpenAI, Anthropic, Gemini and LangChain call is tracked without changing your code. ## Install ```bash pip install agentcost ``` ## Initialise ```python import agentcost agentcost.init(api_key="sk_your_project_key") ``` That is the whole integration. The SDK monkey-patches the provider clients, so existing OpenAI, Anthropic, Gemini and LangChain code is tracked unchanged. ## Attribute costs to an agent ```python with agentcost.track_costs.agent("research-agent"): result = llm.invoke(prompt) ``` Every call inside the block is attributed to `research-agent`, and the dashboard breaks spend down per agent. ## How it behaves - **Non-blocking.** Events are batched and delivered asynchronously, so delivery never sits in the path of your LLM call. - **Local token counting.** Token counts come from tiktoken and cost is a catalogue lookup — neither blocks your application. - **Local mode.** The SDK can record to disk instead of sending anywhere, for evaluation or air-gapped environments. - **Workflows and traces.** Multi-step agents can tag workflow and step names, so per-run cost, repeated work and step latency become reportable. Full reference — configuration, streaming, external correlation, metadata, event structure, shutdown, error handling and troubleshooting — is at https://agentcost.tech/docs/sdk. --- Canonical HTML: https://agentcost.tech/docs/sdk Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost CLI > Analyse a codebase for LLM cost risk before you deploy it, from the command line or in CI. The CLI ships with the SDK. ```bash pip install agentcost agentcost analyze ``` `agentcost analyze` reads your source, finds the LLM call sites, estimates the token load per run and reports findings — oversized prompts, repeated work inside a single run, unbounded loops and failure-prone steps — before any of it costs money in production. Full flag reference, output formats, CI usage and the privacy note (analysis is local; source is not uploaded) are at https://agentcost.tech/docs/cli. --- Canonical HTML: https://agentcost.tech/docs/cli Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost Model Catalogue > Every model AgentCost can bill, with live per-token pricing across OpenAI, Anthropic, Google, AWS, Azure and 50+ other providers. The catalogue covers 3,500+ models across 50+ providers and is synced from LiteLLM's continuously updated pricing database. Each entry carries the per-1,000 token input and output rate, the cached-input and cache-write rates where the provider publishes them, the modality (chat, embedding, image generation, and so on) and any upstream-announced retirement date. The browsable table is at https://agentcost.tech/docs/models. To read it programmatically — which is what you want if you are an agent: ```bash curl https://agentcost.tech/api/v1/pricing curl https://agentcost.tech/api/v1/pricing/gpt-4o curl https://agentcost.tech/api/v1/pricing/deprecations ``` No credentials required. Schema: https://agentcost.tech/openapi.json --- Canonical HTML: https://agentcost.tech/docs/models Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost Data and Privacy Architecture > Exactly which fields the SDK transmits, which it never collects, and how to verify that yourself. A field-by-field account of what the SDK sends and what it does not, covering: what is transmitted with each event, what is never collected, the hashing applied to fields used for de-duplication, the custom fields you control, hosted versus local mode, credential handling, retention, how to verify the above yourself, and how to get in touch about data handling. The full document is at https://agentcost.tech/docs/privacy. The legal privacy policy is a separate document at https://agentcost.tech/privacy. --- Canonical HTML: https://agentcost.tech/docs/privacy Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost REST API > The AgentCost HTTP API: public model pricing with no credentials, plus authenticated ingestion and analytics. OpenAPI 3.1 spec published. Origin: https://api.agentcost.tech. A cached mirror of the public read endpoints is served from https://agentcost.tech/api/v1 — same paths, same payloads — and the mirror does not sleep, so it is the better choice for an agent. Machine-readable specification: https://agentcost.tech/openapi.json (YAML at https://agentcost.tech/api/openapi.yaml). ## Public — no credentials required - `GET /v1/health` — service status and version. - `GET /v1/pricing` — the whole catalogue keyed by model name, with per-1k input, output, cached-input and cache-write rates, provider, modality and any announced retirement date. Optional `?provider=` filter. - `GET /v1/pricing/{model_name}` — rates for one model, resolved the same way ingestion resolves them (exact, then deterministic fuzzy). An unknown model returns zeros with `source: "fallback"` rather than a 404. - `GET /v1/pricing/deprecations` — active models with an announced retirement date, soonest first. - `GET /v1/pricing/sync/status` — catalogue size, freshness and per-provider counts. - `POST /api/v1/estimate` — cost estimate for a model and a token count. Mirror only. ## Estimate a call before you make it ```bash curl -X POST https://agentcost.tech/api/v1/estimate -H "Content-Type: application/json" -d '{"model": "gpt-4o", "input_tokens": 12000, "output_tokens": 800}' ``` Returns the input, output and total cost in USD, the rates used, and the catalogue entry the model name resolved to. ## Authenticated Ingestion (`POST /v1/events/batch`), analytics, projects, budgets and optimizations need either a project API key (`Authorization: Bearer sk_...`) or a session token plus a `project_id` query parameter. ## Errors Every error returns JSON with a machine-readable envelope: ```json { "error": { "code": "not_found", "message": "human-readable statement of what went wrong", "hint": "what to do next", "status": 404, "docs": "https://agentcost.tech/docs/api" }, "detail": "same message, kept for existing clients" } ``` Full endpoint-by-endpoint reference: https://agentcost.tech/docs/api --- Canonical HTML: https://agentcost.tech/docs/api Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost vs Helicone > An honest comparison of AgentCost and Helicone for LLM cost tracking — pricing, self-hosting, integration method, and which one fits your team. **What Helicone is:** Helicone is an LLM observability and monitoring platform, offered as a hosted service with a free tier and paid plans. Both AgentCost and Helicone answer the same underlying question: where is your LLM spend actually going? They differ mainly in how you integrate them and what you pay. Helicone is a hosted product with a generous free tier and paid plans that scale with usage. AgentCost is MIT-licensed and free at every level — use the free hosted cloud, or run the same stack on your own infrastructure. ## Side by side | | AgentCost | Helicone | | --- | --- | --- | | Price | Free — no tiers, no seat limits | Hobby free; Pro $79/mo; Team $799/mo; Enterprise on request | | Free tier limits | None — unlimited events, history, and users | 10,000 requests, 1 GB storage, 1 seat, 1 organization | | License | MIT | Describes itself as open source; license not stated on the pricing page | | Self-hosting | Yes, free — Docker on your infrastructure (hosted cloud also free) | On-prem deployment listed under the Enterprise tier | | Integration | Two lines of Python; no proxy, no base-URL change | Typically routed through Helicone's gateway or SDK | | Providers auto-instrumented | OpenAI, Anthropic, Gemini, LangChain | Broad provider coverage via the gateway | | Model pricing database | 3,500+ models, synced from LiteLLM | Maintained by Helicone | | Maturity | Alpha — young project, small team | Established product with SOC-2 and HIPAA on higher tiers | ## When Helicone is the better choice - You want a managed service with no infrastructure to run, and someone to call when it breaks. - You need SOC-2 or HIPAA compliance, which Helicone offers on its Team tier. - Your team is happy routing traffic through a hosted gateway. - You want a product with a longer track record than AgentCost currently has. ## When AgentCost is the better choice - You don't want request volume to determine your bill — AgentCost is free at any scale. - You want a free hosted cloud with a self-host escape hatch — same MIT code either way, no lock-in. - You'd rather not put a proxy in the path of every LLM call. AgentCost instruments the client libraries in-process instead. - You want per-agent attribution in a multi-agent system as a first-class feature. ## FAQ ### Is AgentCost a drop-in replacement for Helicone? Not exactly. Helicone commonly sits in the request path as a gateway, while AgentCost instruments the provider SDKs in-process. If you rely on gateway-level features such as caching or request routing, AgentCost does not replace those. ### Is AgentCost really free, or is there a paid tier later? It is MIT-licensed and free, with no tiers, seat limits, or paywalled features. Use the free hosted cloud, or self-host it — then your only cost is the infrastructure you already run. ### Can I run both? Yes. They instrument at different layers, so running AgentCost alongside a gateway is possible, though you would be recording the same calls twice. Competitor claims read from https://www.helicone.ai/pricing on 2026-07-28. --- Canonical HTML: https://agentcost.tech/compare/helicone Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost vs Langfuse > An honest comparison of AgentCost and Langfuse — pricing, self-hosting, tracing depth, and which tool fits your LLM cost tracking needs. **What Langfuse is:** Langfuse is an open-source LLM engineering platform covering tracing, evaluation, and prompt management, available both self-hosted and as a paid cloud service. Langfuse is the broader product. It covers tracing, evaluations, prompt management, and datasets — cost tracking is one part of a larger LLM engineering platform. AgentCost is deliberately narrower: it answers which agent spent what, across which models, and what to do about it. If you want a full evaluation and prompt-management stack, Langfuse does considerably more. If you want cost attribution without adopting a platform, AgentCost is smaller. ## Side by side | | AgentCost | Langfuse | | --- | --- | --- | | Price (cloud) | Free hosted cloud — or self-host, also free | Hobby free; Core $29/mo; Pro $199/mo; Enterprise $2,499/mo | | Free tier limits | None — unlimited events and users | 50k units/month, 30 days data access, 2 users | | Usage overage | Not applicable | $8 per 100k units, decreasing at higher volume | | Self-hosting | Yes, free — Docker on your infrastructure (hosted cloud also free) | Yes, free and open source, via Docker Compose or Kubernetes | | Scope | Cost tracking and optimization | Tracing, evaluations, prompt management, datasets | | Integration | Two lines of Python, auto-instrumented | SDK instrumentation, decorators, or OpenTelemetry | | Model pricing database | 3,500+ models, synced from LiteLLM | Maintained by Langfuse | | Maturity | Alpha — young project, small team | Widely adopted, large community | ## When Langfuse is the better choice - You need evaluations, prompt management, or dataset tooling as well as cost data. - You want deep, span-level tracing of complex chains, not just cost attribution. - You'd prefer a managed cloud option with a support relationship. - You want a mature project with a large community behind it. ## When AgentCost is the better choice - Cost is the actual problem you're solving, and you don't want to adopt a whole platform to solve it. - You want setup measured in minutes: pip install, two lines, done. - You want unlimited retention and users without a monthly bill. - You want per-agent cost attribution and optimization suggestions specifically. ## FAQ ### Langfuse is also open source and self-hostable — what's different? Scope and setup cost. Langfuse is a full LLM engineering platform; AgentCost does cost observability only, with a two-line integration. If you need evaluations and prompt management, Langfuse is the better fit. ### Does AgentCost do tracing? It records every LLM call with model, tokens, cost, latency, and the agent responsible. It does not offer span-level tracing of arbitrary application logic the way a full tracing platform does. ### Can I use both together? Yes. They instrument independently, so you can run Langfuse for tracing and evaluation while AgentCost handles cost attribution. Competitor claims read from https://langfuse.com/pricing on 2026-07-28. --- Canonical HTML: https://agentcost.tech/compare/langfuse Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost vs LiteLLM > AgentCost and LiteLLM solve different problems — one tracks LLM cost, the other routes LLM traffic. Here's how they compare and how they work together. **What LiteLLM is:** LiteLLM is an open-source AI gateway and LLM proxy that gives you one interface across many providers, with routing, budgets, and rate limits. These two are often compared but they sit at different layers, and the honest answer is that they complement each other more than they compete. LiteLLM is a gateway: it normalizes 140+ providers behind one interface and handles routing, virtual keys, and rate limits. AgentCost is cost observability: it attributes spend to the agent that caused it. AgentCost's own pricing database is in fact synced from LiteLLM's — that's where the 3,500+ model prices come from. ## Side by side | | AgentCost | LiteLLM | | --- | --- | --- | | Primary purpose | Cost attribution and optimization | Gateway and proxy — routing, keys, rate limits | | Price | Free, MIT | Free Forever tier; Enterprise at custom pricing | | License | MIT | MIT for the open-source gateway | | Sits in the request path | No — instruments the SDK in-process | Yes — traffic is routed through the proxy | | Per-agent attribution | First-class, via a context manager | Virtual keys, budgets, and teams | | Provider coverage | OpenAI, Anthropic, Gemini, LangChain auto-instrumented | 140+ provider integrations | | Enterprise extras | None — everything is included | SSO, RBAC, audit logs, JWT auth, support SLAs | ## When LiteLLM is the better choice - You need one interface across many model providers. - You want routing, load balancing, or failover between models. - You want to enforce budgets and rate limits at the gateway before a call is ever made. - You need virtual API keys per team or customer. ## When AgentCost is the better choice - You already know which providers you're calling and just need to know what they cost you. - You don't want a proxy hop added to every request. - You want spend attributed per agent in a multi-agent system. - You want cost dashboards and optimization suggestions rather than traffic control. ## FAQ ### Should I pick AgentCost or LiteLLM? Usually neither instead of the other. LiteLLM controls how calls are routed; AgentCost reports what those calls cost and which agent caused them. Many teams run a gateway and a cost tracker together. ### Does AgentCost work if my calls already go through LiteLLM? AgentCost instruments the OpenAI, Anthropic, Gemini, and LangChain client libraries in your process. If your application calls those SDKs, tracking works regardless of where the request is ultimately routed. ### Is AgentCost built on LiteLLM? No, but it uses LiteLLM's continuously updated model pricing database as the source for its 3,500+ model prices, which is why cost calculations stay current. Competitor claims read from https://www.litellm.ai/ on 2026-07-28. --- Canonical HTML: https://agentcost.tech/compare/litellm Machine-readable index: https://agentcost.tech/llms.txt * * * # About AgentCost > AgentCost is an open-source LLM cost observability platform, free hosted or self-hosted, built by Kushagra Agrawal. AgentCost is an LLM cost observability platform. It records every model call an application makes and attributes the cost to the agent, workflow and project responsible — so a team running multi-agent systems can see which part of the system is expensive, not just what the monthly provider invoice totals. ## What we build - A Python SDK, published on PyPI as `agentcost`, that tracks OpenAI, Anthropic, Gemini and LangChain calls after a two-line integration. - A FastAPI backend that ingests those events, prices them against a catalogue of 3,500+ models synced from LiteLLM, and exposes analytics over HTTP. - A Next.js dashboard for spend breakdowns, budget guardrails, optimization recommendations and executive reporting. - A command-line analyser, `agentcost analyze`, that estimates cost risk in a codebase before it ships. ## How it is licensed The stack is MIT-licensed and the hosted cloud is free — no tiers, no seat limits, no usage caps, and no feature held back for a paid plan. You can run the same code on your own infrastructure with Docker instead; in that mode nothing leaves your environment and the software does not phone home. ## Who builds it AgentCost was founded and is maintained by Kushagra Agrawal. Development happens in the open at https://github.com/agentcost-ai, and the SDK is released to PyPI at https://pypi.org/project/agentcost/. ## Contact hello@agentcost.tech — see https://agentcost.tech/contact. --- Canonical HTML: https://agentcost.tech/about Machine-readable index: https://agentcost.tech/llms.txt * * * # Contact AgentCost > How to reach AgentCost about support, security, data handling, partnerships and press. **Email:** hello@agentcost.tech — the fastest route for anything. ## What to send where - **Support and setup questions** — hello@agentcost.tech, or open an issue at https://github.com/agentcost-ai. - **Bug reports and feature requests** — GitHub issues are best. There is also a public feedback board inside the dashboard. - **Security reports** — hello@agentcost.tech. Please include reproduction steps, and do not open a public issue first. - **Data handling, deletion and privacy** — hello@agentcost.tech. What the SDK collects is documented at https://agentcost.tech/docs/privacy, and the policy is at https://agentcost.tech/privacy. - **Press and partnerships** — hello@agentcost.tech. ## For agents If you are an agent acting on someone's behalf, you do not need to contact anyone to use the public API. The model catalogue and the cost estimator are open at https://agentcost.tech/api/v1, and the specification is at https://agentcost.tech/openapi.json. ## Company AgentCost, founded by Kushagra Agrawal. Source: https://github.com/agentcost-ai Package: https://pypi.org/project/agentcost/ --- Canonical HTML: https://agentcost.tech/contact Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost Blog > Guides and product notes on LLM cost tracking, budget guardrails, and multi-provider attribution. ## Posts - [Executive Reports: Board-Ready Cost & Usage in One Click](https://agentcost.tech/blog/executive-cost-and-usage-reports) — 2026-06-28, 4 min read. A single, exportable report that opens with a one-glance executive summary and continues into deep breakdowns — latency percentiles, cost concentration, error analysis, usage cadence, and savings — across any time range. - [Budget Guardrails for LLM Spend](https://agentcost.tech/blog/budget-guardrails-for-llm-spend) — 2026-05-24, 5 min read. Stop surprise bills with project-level monthly budgets, threshold alerts, and hard-cap enforcement — now with real-time in-app and email notifications. - [Unified Cost Tracking Across OpenAI, Anthropic, and LangChain](https://agentcost.tech/blog/openai-anthropic-langchain-tracking) — 2026-03-20, 3 min read. One observability layer for the three integration paths almost every production stack uses. --- Canonical HTML: https://agentcost.tech/blog Machine-readable index: https://agentcost.tech/llms.txt * * * # Executive Reports: Board-Ready Cost & Usage in One Click > A single, exportable report that opens with a one-glance executive summary and continues into deep breakdowns — latency percentiles, cost concentration, error analysis, usage cadence, and savings — across any time range. Published 2026-06-28 · 4 min read · Product Your dashboard answers questions live, one panel at a time. But when finance asks 'what did we spend last month, and why?', or a customer wants a usage summary, you need a single document you can read top to bottom — or hand to someone who will. That document is the new Executive Report. Every report opens with an executive summary: total spend, calls, tokens, success rate, average latency, and projected monthly run-rate — each with a period-over-period delta against the immediately preceding window of equal length, so a 30-day report compares against the 30 days before it. The headline is the part anyone can read; everything below it is for the people who need the detail. And there is a lot of detail. Latency percentiles (p50/p95/p99), not just averages — because averages hide the tail that actually pages your on-call. Cost concentration, showing how few models drive most of your spend (the classic Pareto split). Token efficiency, with blended cost per 1K tokens and your input-to-output ratio per model. A reliability section that breaks failures down by model and lists your most frequent errors verbatim. A usage cadence view that surfaces your busiest day and hour. And an optimization-savings rollup that ties straight back to the recommendations engine. It runs over any window: the standard presets, month-to-date, or a fully custom start-and-end date range for billing-aligned reporting. Two export paths ship with it. PDF renders a clean, letterheaded document — not a screenshot of the dashboard, but a purpose-built page with its own typography, KPI grid, tables, and inline charts, so it prints the same on every machine. CSV exports the raw breakdown tables (models, agents, errors, cadence) with a UTF-8 byte-order mark so currency symbols and accented text open correctly in Excel on the first try. You will find it in the dashboard sidebar under Reports. It works against your live data, and it works in the no-signup demo too — open the demo, pick a range, and export a sample report to see exactly what your finance team would receive. --- Canonical HTML: https://agentcost.tech/blog/executive-cost-and-usage-reports Machine-readable index: https://agentcost.tech/llms.txt * * * # Budget Guardrails for LLM Spend > Stop surprise bills with project-level monthly budgets, threshold alerts, and hard-cap enforcement — now with real-time in-app and email notifications. Published 2026-05-24 · 5 min read · Product Observability tells you what happened. Governance tells you what should not happen. Until this release, AgentCost only solved the first half. Budget Guardrails close the loop. Every project can now define a monthly USD budget, a list of alert thresholds (defaults: 50%, 80%, 100%), and one of three enforcement modes: off, warn, or hard cap. In warn mode, owners and project admins receive an in-app notification and an email the first time each threshold is crossed in a calendar month — deduplicated so a noisy ingestion batch can not trigger repeat alerts. In hard cap mode, the ingestion endpoint returns 429 once month-to-date spend reaches the budget, protecting you from runaway agents and broken loops in production. Thresholds are evaluated on every event batch, against month-to-date cost in UTC. The projected spend (current spend + the incoming batch) is what gets compared, so a single large batch that would push you across the cap is rejected before it is persisted, not after. The deduplication is enforced at the database layer with a unique index on (project_id, period_key, threshold_percent), so a restarted worker or a retried batch can not double-alert. On the dashboard side, the new Budget Guardrails card in Settings shows month-to-date spend, a utilization bar that changes color as you approach the cap, the configured thresholds as chips you can add or remove, and the enforcement mode as a single dropdown. The new bell icon in the top-right of every dashboard page surfaces budget alerts (and any future user-scoped notifications) with a live unread count. If you have not set a budget yet, nothing changes — the feature is opt-in per project. To enable it, head to Settings → Budget Guardrails and pick the mode that fits your environment. Most teams start in warn mode for a billing cycle, then promote to hard cap once they trust the threshold values. --- Canonical HTML: https://agentcost.tech/blog/budget-guardrails-for-llm-spend Machine-readable index: https://agentcost.tech/llms.txt * * * # Unified Cost Tracking Across OpenAI, Anthropic, and LangChain > One observability layer for the three integration paths almost every production stack uses. Published 2026-03-20 · 3 min read · Guides Most production LLM stacks are not single-provider. A typical setup calls OpenAI for chat, Anthropic for long-context reasoning, and routes some workflows through LangChain. Fragmented per-provider dashboards make it hard to answer the basic question: which model is actually costing us money this week? The AgentCost SDK now instruments all three paths through a single import. No wrappers, no decorators, no proxy URLs — lightweight interception attaches to the provider clients you already use and reports usage, tokens, and cost in a normalized schema. Once events are flowing in, the dashboard surfaces per-model and per-agent breakdowns side by side, so model-routing decisions become a one-look exercise instead of a multi-tab spreadsheet. --- Canonical HTML: https://agentcost.tech/blog/openai-anthropic-langchain-tracking Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost Terms of Service > The terms governing use of the AgentCost hosted service and website. The operative document is the HTML page at https://agentcost.tech/terms. It covers acceptance of terms, description of the service, account registration and security, acceptable use, the MIT licence position on the open-source code, intellectual property, disclaimers and limitation of liability, termination, changes to the terms, and how to contact us (hello@agentcost.tech). This markdown entry is a pointer, not a substitute. --- Canonical HTML: https://agentcost.tech/terms Machine-readable index: https://agentcost.tech/llms.txt * * * # AgentCost Privacy Policy > What personal data the AgentCost hosted service collects, why, and how to have it deleted. The operative document is the HTML page at https://agentcost.tech/privacy. It covers the information collected, how it is used, storage and security, sharing and disclosure, data retention, your rights including deletion, cookies and analytics, children's privacy, international transfers, changes to the policy, and how to contact us (hello@agentcost.tech). The technical companion — the exact fields the SDK transmits and the fields it never collects — is at https://agentcost.tech/docs/privacy. This markdown entry is a pointer, not a substitute. --- Canonical HTML: https://agentcost.tech/privacy Machine-readable index: https://agentcost.tech/llms.txt * * *