Get started
Introduction
AgentCost is cost observability for LLM agents.
To get started with AgentCost, you'll need:
- A free account with a project — an API key is created for you at sign-up
- The Python SDK, installed with
pip install agentcost
Then every OpenAI, Anthropic, Gemini and LangChain call is priced and attributed to the agent, workflow and step that made it — without changing your code:
- Track: cost per call, per agent and per run, with token counts and latency
- Guard: monthly budgets, anomaly detection and per-agent tool guardrails
- Predict: price a codebase before it ships with the CLI
Quick start
Two lines. Your existing calls are tracked without changes.
pip install agentcost
from agentcost import track_costs
track_costs.init(api_key="sk_your_project_key", project_id="your-project-uuid")Guides
Learn how to get AgentCost set up in your project.
Machine-readable resources
The same surface for agents and tooling.
OpenAPI 3.1 spec
Every operation typed, with a unique operationId. YAML mirror at /api/openapi.yaml.
MCP endpoint
Streamable HTTP. Pricing capabilities as typed MCP tools for any client that speaks the protocol.
Public API
Model pricing and cost estimation, cached and always awake. No credentials.
llms.txt
This site indexed for agents. Every page also answers to Accept: text/markdown.