Read the unified cost-economics roll-up
GET /api/v1/insights/cost-economics answers one FinOps question across every channel at once: what does one unit actually cost us — per message, per minute, per 1,000 tokens? Until now each Insights slice answered a narrower version of that question (token spend, per-conversation P&L, per-agent margin). This surface is the roll-up a CX or operations leader opens first: five channels, one window, one per-unit ratio per channel, and the blended totals underneath.
The behavior guide for the underlying per-channel numbers is Read the cost-intelligence dashboards. This guide covers the roll-up itself — what the endpoint returns, how to set the unit rates it prices with, and how to reconcile its volumes against your invoices.
1. What the surface answers
Channels bill on different units, which makes cross-channel cost comparisons hard to eyeball. The roll-up normalizes each channel onto its own billed unit:- Per message — SMS and WhatsApp. The volume is the sum of billed segments, not message rows: a 240-character SMS is two segments and prices as two units, the same basis a carrier invoice uses.
- Per minute — voice and video. The volume is connected seconds rounded up to whole minutes — a 65-second call prices as two minutes, matching per-minute carrier increments. A call that never connected contributes zero.
- Per 1,000 tokens — AI. The volume is raw tokens (input, output, and cached tokens), priced per thousand.
cost ÷ volume) — so “is WhatsApp really five times SMS per message?” is one row read, not a spreadsheet. Cross-channel totals sit at the bottom.
Access follows the standard Insights pattern: an authenticated session on your organization, org-scoped so no operator ever reads another workspace’s numbers.
Two conventions to internalize before reading any number:
- Money is integer cents end-to-end.
cost_centsof15234is $152.34 in your org currency; thecurrencyfield on the response tells you which. Format with your org’s wallet currency. - The ratio is
null, never0, when the channel had no volume. A zero-traffic channel reportsper_unit_cost_cents: null— render ”—”, not $0.00/unit. A null ratio means “nothing billed”, not “free”.
2. Reading GET /api/v1/insights/cost-economics
Both parameters are optional. Omit them and the window is the last 30 days ending now; pass only one side and the other backfills (30 days back from
to, or up to now from from). A from ≥ to is a 400, and the resolved window is capped at 365 days.
The response arrives in the standard { data, meta } envelope. Under data:
Per-channel rows — the unit semantics are the whole point:
In
totals, message_volume sums the two message channels (SMS + WhatsApp), voice_minutes sums the two minute channels (voice + video), and ai_tokens stands on its own. totals.cost_cents is the exact sum of the five channel cost_cents — sum the array and you must land on the total to the cent; that equality is the reconciliation check in §4.
Because cost is volume × applied rate on each row, every row’s ratio reads back the applied rate for that channel (null on zero volume). The ratio column exists so you can sort five channels on one number without re-deriving the division.
3. Reading and setting rates — /cost-economics/config
The roll-up prices volumes with five per-unit rates, one per channel basis. Rates are tenant-owned: each workspace sets its own cost basis (what your carriers and model providers charge you), and unset dimensions fall back to platform reference rates. Nothing here changes what your wallet is billed; it changes the economics view you read. Read the current config:data block carries five nullable fields, all integer cents:
Update any subset of them:
- Omitted fields keep their current value. The example above touches WhatsApp and voice only; SMS, AI, and video are preserved.
- An explicit
nullclears a field back to the platform reference rate, and the summary’sappliedblock drops back to it. - Values must be non-negative integer cents; a fractional or negative value is a 400.
- The PUT response returns the merged, persisted config — read it back to confirm what your update actually resolved to.
totals.cost_cents before and after.
Worked example — one WhatsApp campaign, one voice queue month
Price a WhatsApp campaign. Set the per-message cost your Meta billing runs at, then read the month the campaign sent:volume: 120000, cost_cents: 480000 ($4,800.00), per_unit_cost_cents: 4. Compare that 4¢ unit against the SMS row for the same window to decide the next campaign’s channel mix — that is the comparison this surface exists for.
Price a voice queue month. Set your per-minute carriage cost, then read the queue’s month:
volume is the per-call ceiling sum (say 735 minutes for a skewed call-length mix), cost_cents = volume × 2, and per_unit_cost_cents: 2. The round-up is deliberate — it matches the minute increments on your carrier invoice, so the volume here ties to the bill instead of to a wall-clock sum.
4. Mapping roll-ups to billed units — the reconciliation walkthrough
Finance’s question is always the same: does this view tie to the invoice? The roll-up is built to make that a two-minute check, because every volume convention above mirrors a billed-unit convention:- Pick one window — say your billing month — and pull
GET /api/v1/insights/cost-economics?from=<month start>&to=<month end>. - Internal consistency: sum
channels[].cost_cents; the result must equaltotals.cost_centsto the cent. A mismatch means you compared different windows — re-checkfrom/toin the response. - SMS on the segment basis: SMS
volumehere is billed segments, so it matches the segment counters on the Billable usage records panel (GET /api/v1/messages/usage/records), not the billed-message headline on the Channel costs page. Do not “fix” the difference by filtering; Read the cost-intelligence dashboards explains the segments-versus-messages convention and the full dashboard-versus-API verification loop. - Voice on the billed-minute basis: voice
volumeis per-call seconds rounded up — the same increments a carrier invoice lists. Compare against the voice records on the same usage-records export for the same window. - Revenue side: the roll-up is a cost view, so map it against what you charged for the same traffic — your rate cards hold the sell-side unit prices, and Billing cost calculator walks the cost-versus-price margin arithmetic with your own volume mix.
applied match your carrier and model-provider rates, totals.cost_cents is your expected cost line for the window before overheads.
5. Sample responses
GET /api/v1/insights/cost-economics?from=2026-08-01T00:00:00Z&to=2026-09-01T00:00:00Z — SMS, WhatsApp, voice, and AI carried traffic; video did not (note thenull ratio):
applied.ai_per_1000_tokens_cents for the actual rate when a ratio sits at zero on a low-rate channel. Video had no traffic, so its ratio is null.
GET /api/v1/insights/cost-economics/config — one override set:
null on SMS means “reference rate applies”, and the three untouched fields kept their prior (unset) values.
See also
- Read the cost-intelligence dashboards — the per-channel cost surfaces behind the roll-up, and the dashboard-versus-API verification loop
- Insights API reference — endpoint shapes for the Insights surfaces
- Rate cards — the sell-side unit prices to map these costs against
- Billing cost calculator — cost-versus-price margin arithmetic on your own volume mix
- Read the Channel costs page — the console counterpart for per-channel spend
- AI agent cost controls — budgets and hard caps for the AI token leg