Read your workspace's usage
const url = 'https://example.com/v1/usage?from=2026-04-15T12%3A00%3A00Z&to=2026-04-15T12%3A00%3A00Z';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/usage?from=2026-04-15T12%3A00%3A00Z&to=2026-04-15T12%3A00%3A00Z' \ --header 'Authorization: Bearer <token>'Your workspace’s usage records aggregated by the dimensions in groupBy: each group’s count, the sum of its quantities, and its first and last times. Never a record’s content. Over the projects you may read: a tenant admin’s covers every project and the records with none; anyone else’s, only the projects they may read, and one they can’t read is absent rather than an error. watermark: every record at or before it is in the answer, so re-read a window until its watermark is past the window’s end; every page of one read carries the same watermark. A runtime that doesn’t count usage (KINDGI_USAGE_METERING unset or off) answers 404. Model-call cost is on /v1/cost.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”A page of groups.
object
Examplegenerated
{ "data": [ { "tenantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "projectId": "example", "agentId": "example", "kind": "example", "class": "example", "state": "example", "day": "example", "count": 1, "quantity": 1, "firstAt": "2026-04-15T12:00:00Z", "lastAt": "2026-04-15T12:00:00Z" } ], "watermark": "2026-04-15T12:00:00Z", "nextCursor": "example"}A window, filter, limit or cursor this route can’t read (bad-input), naming which.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The projects you may read can’t be listed on this deployment, so usage across projects can’t be limited to them (permission-denied): ask for one with projectId.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The database was too busy to answer in time (database-busy), or the authorization store couldn’t be reached (authz-backend-unavailable); Retry-After (whole seconds) says when to try again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}