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.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
project | query | string | no | Limits the report to one project of the organization (prj_...). Any other project is 404. |
start_date | query | string (date) | no | The 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_date | query | string (date) | no | The 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 "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:
| Field | Type | Required | Description |
|---|---|---|---|
date | string (date) | yes | |
project | string | yes | |
calls | integer | yes | |
runs | integer | yes | |
tokens_in | integer | yes | |
tokens_out | integer | yes | |
spend_usd | string | yes |
{
"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"
}
]
}| Status | Meaning |
|---|---|
400 | Bad request (validation, invalid_cursor, out_of_bounds) |
401 | Unauthenticated (missing, invalid, or expired token) |
403 | Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key) |
404 | Not found |
500 | Internal server error |
503 | Service 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 "https://api.mubit.ai/api/v1/billing" \
-H "Authorization: Bearer $MUBIT_MANAGEMENT_KEY"Response 200: Billing status
| Field | Type | Required | Description |
|---|---|---|---|
balance_usd | string | no | The credit balance. Returned to a key of role admin only; for any other key the field is left out. |
has_card | boolean, nullable | yes | Whether 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_last4 | string, nullable | no | The 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_status | string | yes | active, 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"
}| Status | Meaning |
|---|---|
401 | Unauthenticated (missing, invalid, or expired token) |
403 | Forbidden (role_required; project_scoped, because billing is the organization's and a key bound to one project is refused) |
500 | Internal server error |
503 | Service 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.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
project | query | string | no | A project of the organization (prj_...). Another organization's project has an empty feed; a key bound to one project that names another is 404. |
limit | query | integer | no | Number of records to return (1-200) |
cursor | query | string | no | Sealed pagination cursor from previous page |
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:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | The event's id, starting with act_ |
actor | string | yes | Who did it: person:<id> or key:<id>; automatic for Mubit's own steps; unknown where none is recorded |
kind | string | yes | The 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 |
description | string | yes | |
created_at | string (date-time) | yes | |
project | string | no | The 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
}| Status | Meaning |
|---|---|
400 | Bad request (validation, invalid_cursor, out_of_bounds) |
401 | Unauthenticated (missing, invalid, or expired token) |
403 | Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key) |
404 | Not found |
500 | Internal server error |
503 | Service unavailable (unavailable). Retry after the Retry-After seconds. |