usage_summary
Calculate per-company cost attribution and minutes for the current billing cycle to identify the biggest cost drivers and guide client renegotiation, upsell, or drop decisions.
Instructions
Per-company cost-attribution summary for the current cycle.
Aggregates active trackers + per-company call minutes and projects what each client is contributing to the agency's CallRail bill. Useful for:
Deciding which client to renegotiate / upsell / drop
Sanity-checking the upcoming invoice
Quarterly reviews
Pricing assumes Call Tracking Starter ($50 base + 5 numbers + 250 mins bundled; $3/local number, $5/toll-free number, $0.05/local minute, $0.08/toll-free minute over bundle). Edit PRICING_* constants in server.py if you're on a different plan.
Args:
account_id: Auto-resolves if omitted.
days: Lookback window in days (default 30 = roughly one cycle).
Ignored if start_date provided.
start_date: 'YYYY-MM-DD'.
end_date: 'YYYY-MM-DD' (defaults to today).
Returns:
- agency: plan + totals + bundle utilization + cycle estimate
- by_company[]: each company's minutes, active numbers, cost share
(sorted by cost-share descending)
- biggest_cost_driver: name of top company
- partial_failures[]: per-company API errors. Each entry carries
partial_calls_before_failure, partial_minutes_before_failure,
partial_local_numbers, partial_tollfree_numbers so an under-
reporting agency_total is observable, not silent.
- notes: caveats about the cost model (toll-free minute pricing
not yet differentiated; SMS not included).
Cost shares sum exactly to agency.estimated_cycle_total via largest-
remainder rounding.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | No | ||
| days | No | ||
| start_date | No | ||
| end_date | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |