Get cost by model
Aggregates spend by model over a time range, priced in the cluster currency from the model price book. Org-scoped: org admins see their org; cluster admins may pass org_id. Includes billable work with no usage row of its own (store=false responses, agent tool calls), so totals reconcile with the live budget gauge.
Authorizations
Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Headers
Optional external end-user identifier forwarded by the API gateway.
Query Parameters
Unix timestamp, inclusive
0 <= x <= 9007199254740991Unix timestamp, exclusive
0 <= x <= 9007199254740991Cluster admins only: org whose costs to report (defaults to caller's org)
Group cost by model / api_key_id (tenant key) / team_id (sub-tenant within an org) / external_user_id (caller-supplied end user, X-On-Behalf-Of, for resale chargeback) / org_id
model, api_key_id, team_id, external_user_id, org_id Response
OK
-9007199254740991 <= x <= 9007199254740991-9007199254740991 <= x <= 9007199254740991model, api_key_id, team_id, external_user_id, org_id Total cost in integer NANO-units (1e9 per major unit, NOT cents); use total_cost for the major amount.