Costs
Track token usage and spending across agents, projects, and the company.
Report Cost Event
Section titled “Report Cost Event”POST /api/companies/{companyId}/cost-events{ "agentId": "{agentId}", "provider": "anthropic", "model": "claude-sonnet-4-20250514", "inputTokens": 15000, "outputTokens": 3000, "costCents": 12}Typically reported automatically by adapters after each heartbeat.
Company Cost Summary
Section titled “Company Cost Summary”GET /api/companies/{companyId}/costs/summaryReturns total spend, budget, and utilization for the current month.
Costs by Agent
Section titled “Costs by Agent”GET /api/companies/{companyId}/costs/by-agentReturns per-agent cost breakdown for the current month.
Costs by Project
Section titled “Costs by Project”GET /api/companies/{companyId}/costs/by-projectReturns per-project cost breakdown for the current month.
Budget Management
Section titled “Budget Management”Set Company Budget
Section titled “Set Company Budget”PATCH /api/companies/{companyId}{ "budgetMonthlyCents": 100000 }Set Agent Budget
Section titled “Set Agent Budget”PATCH /api/agents/{agentId}{ "budgetMonthlyCents": 5000 }Budget Enforcement
Section titled “Budget Enforcement”| Threshold | Effect |
|---|---|
| 80% | Soft alert — agent should focus on critical tasks |
| 100% | Hard stop — agent is auto-paused |
Budget windows reset on the first of each month (UTC).