ProviderCosts

Per-customer margin report (operator only)

Changed on

Rated usage revenue vs stamped provider COGS for a window (ADR-079). A usage unit-economics view — base fees, credits, and taxes are not included. Per-model margin renders only where pricing rules pin the model; other revenue is reported unattributed, never allocated by heuristic.

get/v1/customers/{id}/margin

Request

  • Base URL: http://localhost:8080
  • URL: http://localhost:8080/v1/customers/{id}/margin
  • Auth: HTTP bearer

Path parameters

idstring required

Query parameters

fromstring date-time
tostring date-time

Response

Margin report

customer_idstring required
fromstring date-time required
tostring date-time required
revenue_centsinteger required

Total rated usage revenue in the window.

cost_microsinteger required

Total stamped provider cost, micro-dollars.

margin_bpsinteger

(revenue − cost) / revenue in basis points. Omitted when revenue is 0.

unattributed_revenue_centsinteger required
unresolved_eventsinteger required

Token events with costable dims but no matching rate — add a rate to cost new events.

cache_write_excludedboolean

Changes