Python (SDK)
Usage
Aggregate cost by dimension
Sums stored per-entry cost over [start_time, end_time), grouped by any of service, task_type, model, api_key_id, team_id, user_id, external_user_id, org_id. Point-in-time correct for chargeback/showback.
GET
Python (SDK)
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>.
Query Parameters
Window start, epoch seconds (inclusive)
Required range:
-9007199254740991 < x <= 9007199254740991Window end, epoch seconds (exclusive)
Required range:
-9007199254740991 < x <= 9007199254740991CSV of grouping dimensions: service, task_type, model, api_key_id, team_id, user_id, external_user_id, org_id
Target org (cluster admins only; omit for cluster-wide)
Minimum string length:
1