Cost Tracking
The cost tracking system provides real-time visibility into LLM spend across your entire agent deployment. It breaks down costs by provider, agent, and pipeline run, enabling teams to identify expensive operations, set budget guardrails, and optimize model selection.
Real-Time Spend Tracking
Every LLM call made by any agent is recorded with its token usage and cost. The dashboard displays a live cost ticker that updates as agents execute, showing:
- Total spend today with comparison to yesterday
- Running monthly total with projection to end of billing period
- Cost per pipeline run averaged across recent executions
Cost Breakdown by Provider
Costs are segmented by LLM provider for clear visibility into where spend is concentrated.
| Provider | Models Used | Typical Use Case |
|---|---|---|
| OpenAI | GPT-5.1, GPT-4.1 | Style analysis, text generation |
| Anthropic | Claude Sonnet 4, Claude Haiku | Chat, classification, evaluation |
| Gemini 2.5 Pro, Gemini 2.5 Flash | Vision analysis, multimodal tasks | |
| DeepSeek | DeepSeek-V3, DeepSeek-R1 | Critique, reasoning-heavy tasks |
The provider breakdown view shows a stacked bar chart of daily spend per provider, making it easy to spot cost shifts when switching models or adjusting agent configurations.
Cost Breakdown by Agent
Each agent’s cumulative cost is tracked individually. The per-agent view shows:
- Total cost over selected time period
- Average cost per execution
- Token efficiency (cost per useful output token)
- Cost trend line (increasing, stable, decreasing)
This view is critical for identifying which agents are the most expensive and whether their cost is justified by their output quality.
Cost Breakdown by Pipeline Run
Every pipeline execution is tagged with a run_id that aggregates the costs of all agents involved. This gives a true end-to-end cost for each user request, including:
- Individual agent costs within the pipeline
- Retry costs (when agents fail and are re-executed)
- Total pipeline cost with breakdown percentage per agent
Budget Alerts and Thresholds
Configure budget limits at multiple levels:
| Level | Description | Example |
|---|---|---|
| Organization | Total monthly spend cap | $500/month |
| Agent | Per-agent daily limit | $20/day for vision agent |
| Pipeline | Per-run cost ceiling | $0.50 per pipeline execution |
When a threshold is approached (80% by default), the dashboard displays a warning. When a threshold is exceeded, the system can be configured to:
- Send a notification to the dashboard
- Trigger a webhook to external systems
- Route the operation to an approval queue
- Block execution until budget is reset
Model Cost Comparison
The dashboard includes a reference table of supported model pricing to inform model selection decisions.
| Model | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|
| GPT-5.1 | $2.00 | $8.00 |
| GPT-4.1 | $2.00 | $8.00 |
| GPT-4.1 mini | $0.40 | $1.60 |
| GPT-4.1 nano | $0.10 | $0.40 |
| Claude Sonnet 4 | $3.00 | $15.00 |
| Claude Haiku 3.5 | $0.80 | $4.00 |
| Gemini 2.5 Pro | $1.25 | $10.00 |
| Gemini 2.5 Flash | $0.15 | $0.60 |
| DeepSeek-V3 | $0.27 | $1.10 |
| DeepSeek-R1 | $0.55 | $2.19 |
Pricing as of January 2026. Actual costs may vary based on provider agreements.
Projections
The cost tracking system generates daily, weekly, and monthly projections based on current usage patterns:
- Daily projection — extrapolates from current day’s spend rate
- Weekly projection — uses 7-day rolling average
- Monthly projection — uses 30-day trend with seasonality adjustment
Projections are displayed alongside budget thresholds so teams can anticipate overages before they happen.
API Endpoint
Cost Optimization Metrics
Returns comprehensive cost data for the authenticated organization.
GET /api/v1/admin/metrics/cost-optimization{
"total_cost_today": 42.17,
"total_cost_month": 876.43,
"projected_monthly": 1240.00,
"by_provider": {
"openai": 412.30,
"anthropic": 298.15,
"google": 122.48,
"deepseek": 43.50
},
"by_agent": [
{
"agent_id": "vision_analysis_v3",
"cost": 198.40,
"executions": 4210,
"avg_cost_per_run": 0.047
}
],
"budget": {
"monthly_limit": 1500.00,
"utilization_pct": 58.4,
"alert_threshold_pct": 80
}
}This endpoint requires a valid JWT and X-Org-ID header.