The full stack of Agent Unit Economics.
Track every cost. Attribute every dollar. Recover the retry waste. Built for teams running AI agents in production.
Capture every cost automatically
One line of code captures LLM calls, tool APIs, compute, and retry waste — across LangChain, CrewAI, OpenAI Agents SDK, or your own loop. No wrappers. No missed costs.
LLM auto-instrumentation
OpenAI, Anthropic, Gemini, Bedrock, Cohere, LiteLLM, Vercel AI — seven providers, zero config. Every token counted, every cost captured.
163-service catalog
Tavily, Firecrawl, Pinecone, Google Maps, E2B, Browserbase... costs extracted from API responses automatically.
Session auto-grouping
No wrapper code needed. Works with LangChain, CrewAI, OpenAI Agents SDK, custom code. Tasks group automatically.
Dev Mode
See every event in your terminal as it happens. Zero cloud required.
Works with your stack
Initialize once. Every LLM call and HTTP request in your agent is captured automatically. No changes to your existing code.
import dexcost
# One line to start tracking
dexcost.init(api_key="dx_live_...")
# Track a task with full attribution
with dexcost.task(
task_type="resolve_ticket",
customer_id="cust_123",
project_id="support-bot",
) as t:
# All LLM calls and HTTP requests
# inside this block are tracked
result = agent.run(ticket)Recover spend, spot anomalies, understand margins
Tracking is the input. Find the retry waste. Spot the unprofitable customer. Decompose a cost spike before it becomes a budget incident.
Retry cost recovery
See exactly how much you spend on retries — by agent, by task type, by customer. Identify the expensive loops and recover wasted spend.
Anomaly detection
Automatic alerts when task costs spike. Catch runaway agents before they drain your budget.
Customer profitability
Which customers are profitable? Which are costing you margin? Visualize your cost distribution and find the outliers.
Cost decomposition
What's driving cost changes period over period? Is it more tasks, more tokens per task, or price changes? Break it down.
Know exactly who costs what
Full attribution to customers, agents, and task types. Build pricing, find inefficiencies, generate usage statements.
Per customer
Total cost to serve each customer. Revenue minus cost equals margin — per customer, per month.
Per agent
Which agent is expensive, which is efficient? Compare agents head-to-head on cost per task.
Per task type
Average cost per resolve_ticket vs generate_report. Understand the economics of each workflow.
Usage statements
Shareable cost reports per customer per period. Export as CSV or PDF. Ready for billing conversations.
Four SDKs. One schema.
Python, TypeScript, Go, Rust — all instrumenting the same Standard Event Schema. Your data is portable from day one. MIT licensed.
Python
pip install dexcostTypeScript
npm install @dexcost/sdkGo
go get github.com/dexwox/dexcost-goRust
cargo add dexcostimport dexcost
# One line to start tracking
dexcost.init(api_key="dx_live_...")
# Track a task with full attribution
with dexcost.task(
task_type="resolve_ticket",
customer_id="cust_123",
project_id="support-bot",
) as t:
# All LLM calls and HTTP requests
# inside this block are tracked
result = agent.run(ticket)Ready to see your true agent costs?
One line of code. 7 providers. 163 services. Full cost clarity.
Free up to 5,000 tasks/month · No credit card required