Usage API
Reference for the management API's endpoints that return an organization's usage for the month and a database's activity over time.
These endpoints return metered usage. See usage for what is metered and how it is collected, and the management API overview for authentication and errors.
| Method | Path | Does |
|---|---|---|
GET | /v1/usage | Returns the organization's usage for the current month |
GET | /v1/databases/{databaseId}/activity | Returns one database's usage over a window |
Usage is collected from the databases' clusters, so it trails what happened. It is not a bill. The clusters do not report these meters yet, so their figures are zero for now: the figures in the examples below show the shape of an answer. See usage.
Get the organization's usage
GET /v1/usageReturns the usage of the key's organization for the current calendar month, in UTC, against its plan.
It needs a key for the whole organization, of either role. A key scoped to one database is answered 403, because the figures cover the organization's other databases too.
curl "$MIMIC_MANAGEMENT_API/v1/usage" \
-H "Authorization: Bearer $MIMIC_API_KEY"{
"plan": {
"id": "<plan-id>",
"label": "<plan name>",
"maxDatabases": null,
"maxBranches": null,
"isHardCapped": false
},
"periodStart": "2026-01-01T00:00:00.000Z",
"periodEnd": "2026-02-01T00:00:00.000Z",
"meters": [
{
"id": "commits",
"label": "Writes",
"unit": "transactions",
"aggregation": "sum",
"quantity": 17,
"included": null
}
],
"databases": [
{
"databaseId": "db_…",
"name": "production",
"quantities": { "commits": 17, "stored_bytes": 300, "session_seconds": 0 }
}
]
}The values are examples.
| Name | Type | Description |
|---|---|---|
plan * | object | The organization's plan. See below. |
periodStart * | string | The start of the month, inclusive. |
periodEnd * | string | The start of the next month: the end of the period, exclusive. |
meters * | object[] | Each meter's total across the organization's databases. |
databases * | object[] | Usage per database. Only databases with metered usage this month are listed. |
plan
| Name | Type | Description |
|---|---|---|
id * | string | The plan's ID. |
label * | string | The plan's name, for display. |
maxDatabases * | integer | null | How many databases the organization may have. Null for no limit. |
maxBranches * | integer | null | How many branches each database may have; branches do not count toward `maxDatabases`. Null for no limit. |
isHardCapped * | boolean | Whether the plan is hard-capped. |
The plan's price is not part of this API.
An entry of meters
| Name | Type | Description |
|---|---|---|
id * | string | The meter's ID. It is the key in every quantities object. |
label * | string | The meter's name, for display. |
unit * | string | What quantity counts. |
aggregation * | "sum" | "max" | sum for a counter, whose readings add up; max for a gauge, whose highest reading counts. |
quantity * | number | The month's total across databases. |
included * | number | null | What the plan includes per month. Null when it includes none of this meter. |
For a sum meter, quantity is the sum over the month and across databases. For a max meter, it is each database's highest reading of the month, added up across databases.
An entry of databases
| Name | Type | Description |
|---|---|---|
databaseId * | string | The database's management ID. |
name * | string | The database's name. |
quantities * | Record<string, number> | The database's quantity for each meter, by meter ID. |
Get a database's activity
GET /v1/databases/{databaseId}/activity?window=24hReturns one database's usage over a window, in buckets. A key scoped to that database can call it.
| Name | Type | Description |
|---|---|---|
window * | "24h" | "7d" | "30d" | How far back to go. 24h returns 24 hourly buckets; 7d and 30d return one bucket per day. Required. |
A missing or unknown window is answered 400.
curl "$MIMIC_MANAGEMENT_API/v1/databases/$DATABASE_ID/activity?window=7d" \
-H "Authorization: Bearer $MIMIC_API_KEY"{
"window": "7d",
"bucket": "day",
"start": "2026-01-09T00:00:00.000Z",
"end": "2026-01-16T00:00:00.000Z",
"meters": [
{
"id": "commits",
"label": "Writes",
"unit": "transactions",
"aggregation": "sum",
"billingFeatureId": "<feature-id>"
}
],
"buckets": [
{ "start": "2026-01-09T00:00:00.000Z", "quantities": { "commits": 0 } },
{ "start": "2026-01-15T00:00:00.000Z", "quantities": { "commits": 12 } }
],
"totals": { "commits": 12 },
"latest": { "stored_bytes": { "quantity": 300, "at": "2026-01-15T10:00:00.000Z" } }
}The response is shortened: it holds every bucket of the window and every meter. The values are examples.
| Name | Type | Description |
|---|---|---|
window * | "24h" | "7d" | "30d" | The window asked for. |
bucket * | "hour" | "day" | The size of each bucket. |
start * | string | The start of the first bucket, in UTC. |
end * | string | The end of the last bucket, which is the one in progress. |
meters * | object[] | The meters reported: id, label, unit, aggregation and billingFeatureId. |
buckets * | object[] | One entry per bucket, oldest first, each with its start and its quantities by meter ID. Every bucket of the window is present, with zero where nothing was reported. |
totals * | Record<string, number> | Per meter over the whole window: the sum for a counter, the highest reading for a gauge. |
latest * | Record<string, { quantity: number, at: string } | null> | Each gauge's latest reading and the hour it was taken in, however old. Null when the database never reported it. |
Within a bucket, a counter holds the sum of its readings and a gauge holds its highest reading. For a gauge, a bucket of 0 means nothing was reported in it, not that the database was empty: use latest for the current value.