workspace
Get workspace usage
Changed onGet the usage of your workspace for one calendar month (UTC): billable API operations, compute usage per environment, and active keys per app.
Use this to track usage during the month or to look back at a past month. The response has no prices. Your invoice is the source of truth. Compute usage can be up to 15 minutes late, and it can change for up to 7 days.
Send {} for the current month to date, or {"period": {"year": 2026, "month": 9}} for a full past month. The month must start within the last 90 days.
Required Permissions
Your root key must have this permission:
- unkey:v1:<workspace_id>:usage#read
post/v2/workspace.getUsage
Request
- Base URLhttps://api.unkey.com
- URLhttps://api.unkey.com/v2/workspace.getUsage
- AuthHTTP bearer
Request body
Example request
{
"period": {
"year": 2026,
"month": 9
}
}Response
The workspace usage for the requested month.
Example response
{
"meta": {
"requestId": "req_123"
},
"data": {
"period": {
"start": 1790812800000,
"end": 1790946000000
},
"totals": {
"api": {
"verifications": 40000,
"ratelimits": 2000
},
"compute": {
"cpuSeconds": 5400.5,
"memoryGiBHours": 96.2,
"egressGiB": 1.4
},
"gateway": {
"activeKeys": 12
}
},
"breakdowns": {
"byEnvironment": [
{
"project": {
"id": "proj_1234abcd",
"name": "Payments"
},
"app": {
"id": "proj_1234abcd",
"name": "Payments"
},
"environment": {
"id": "env_1234abcd",
"slug": "production"
},
"compute": {
"cpuSeconds": 5400.5,
"memoryGiBHours": 96.2,
"egressGiB": 1.4
}
}
],
"byApp": [
{
"project": {
"id": "proj_1234abcd",
"name": "Payments"
},
"app": {
"id": "proj_1234abcd",
"name": "Payments"
},
"gateway": {
"activeKeys": 12
}
}
]
}
}
}Changes
- info
endpoint added
- info