Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
API reference

Usage, billing and activity

These operations read what your organization used, its billing status, and what happened in its projects.

All paths are under https://api.mubit.ai, with a management key in Authorization: Bearer. Management API covers keys, roles, pagination, retries and errors. The samples read the key from MUBIT_MANAGEMENT_KEY.

Get usage

GET /api/v1/usage

Returns the calls, runs and tokens counted, and what the runs cost (spend_usd): totals for the window, and in data a row for each project and UTC day. The window is start_date to end_date, both UTC days included. Counts go back 61 days before today: a window that starts earlier, or ends after today, is 400 validation. Left out, end_date is today and start_date is the first day of that month.

Role: read or higher.

Parameters
NameInTypeRequiredDescription
projectquerystringnoLimits the report to one project of the organization (prj_...). Any other project is 404.
start_datequerystring (date)noThe first UTC day of the window (YYYY-MM-DD), no earlier than 61 days before today: the meter holds nothing of an earlier day, and an earlier start is refused with 400 validation. Left out, the first day of the month of end_date (refused in the same way when that day is earlier).
end_datequerystring (date)noThe last UTC day of the window (YYYY-MM-DD), not after today (UTC): a day to come has no counts, and an end after today is refused with 400 validation. Left out, today (UTC).
curl
curl "https://api.mubit.ai/api/v1/usage?start_date=2026-11-01" \
  -H "Authorization: Bearer $MUBIT_MANAGEMENT_KEY"

Response 200: Usage figures

Each item of data:

FieldTypeRequiredDescription
datestring (date)yes
projectstringyes
callsintegeryes
runsintegeryes
tokens_inintegeryes
tokens_outintegeryes
spend_usdstringyes
{
  "start_date": "2026-10-01",
  "end_date": "2026-10-26",
  "total_calls": 15420,
  "total_runs": 15420,
  "total_tokens": 3200400,
  "spend_usd": "4.20",
  "data": [
    {
      "date": "2026-10-25",
      "project": "prj_prod",
      "calls": 6220,
      "runs": 6220,
      "tokens_in": 1100000,
      "tokens_out": 196400,
      "spend_usd": "1.70"
    },
    {
      "date": "2026-10-26",
      "project": "prj_prod",
      "calls": 9200,
      "runs": 9200,
      "tokens_in": 1500000,
      "tokens_out": 404000,
      "spend_usd": "2.50"
    }
  ]
}
Errors
StatusMeaning
400Bad request (validation, invalid_cursor, out_of_bounds)
401Unauthenticated (missing, invalid, or expired token)
403Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key)
404Not found
500Internal server error
503Service unavailable (unavailable). Retry after the Retry-After seconds.

Get billing status

GET /api/v1/billing

Returns whether runs are counted (runs_status) and the payment card (has_card, card_last4). Both card fields are null for now, which means not known, not "no card": test for null before you test for false. A key of role admin also gets the credit balance (balance_usd); for other keys the field is left out. Billing belongs to the organization, so a key bound to one project gets 403 project_scoped.

Role: read or higher.

curl
curl "https://api.mubit.ai/api/v1/billing" \
  -H "Authorization: Bearer $MUBIT_MANAGEMENT_KEY"

Response 200: Billing status

FieldTypeRequiredDescription
balance_usdstringnoThe credit balance. Returned to a key of role admin only; for any other key the field is left out.
has_cardboolean, nullableyesWhether a payment card is on file. In 1.0 it is always null, which means not known and does not mean false: the card is held by the payment processor, which this read does not ask.
card_last4string, nullablenoThe last four digits of the card on file. In 1.0 it is always null (not known), as has_card: null does not mean that there is no card.
runs_statusstringyesactive, or why the organization's runs are not counted: zero_balance, cap_reached or volume_limit
{
  "balance_usd": "50.00",
  "has_card": null,
  "card_last4": null,
  "runs_status": "active"
}
Errors
StatusMeaning
401Unauthenticated (missing, invalid, or expired token)
403Forbidden (role_required; project_scoped, because billing is the organization's and a key bound to one project is refused)
500Internal server error
503Service unavailable (unavailable). Retry after the Retry-After seconds.

List activity

GET /api/v1/activity

Lists your projects' training, rollout, access and policy events, newest first: the newest 100 events of each project. Older events aren't reachable here. project limits the feed to one project; a key bound to one project reads that project's.

Role: read or higher.

Parameters
NameInTypeRequiredDescription
projectquerystringnoA project of the organization (prj_...). Another organization's project has an empty feed; a key bound to one project that names another is 404.
limitqueryintegernoNumber of records to return (1-200)
cursorquerystringnoSealed pagination cursor from previous page
curl
curl "https://api.mubit.ai/api/v1/activity?project=$PROJECT_ID" \
  -H "Authorization: Bearer $MUBIT_MANAGEMENT_KEY"

Response 200: Activity list

Each item of data:

FieldTypeRequiredDescription
idstringyesThe event's id, starting with act_
actorstringyesWho did it: person:<id> or key:<id>; automatic for Mubit's own steps; unknown where none is recorded
kindstringyesThe kind of event, such as training.started, training.completed, training.failed, version.promoted, version.rolled_back, key.created, key.rotated, key.revoked or policy.changed
descriptionstringyes
created_atstring (date-time)yes
projectstringnoThe project the event belongs to (prj_...)
{
  "data": [
    {
      "id": "act_rollout:ad-a:1793012400000000:0000",
      "actor": "person:user_one",
      "kind": "version.promoted",
      "description": "Version 2 of \"Support Triage\" promoted",
      "created_at": "2026-10-26T11:00:00Z",
      "project": "prj_prod"
    }
  ],
  "next_cursor": null
}
Errors
StatusMeaning
400Bad request (validation, invalid_cursor, out_of_bounds)
401Unauthenticated (missing, invalid, or expired token)
403Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key)
404Not found
500Internal server error
503Service unavailable (unavailable). Retry after the Retry-After seconds.