Skip to Content
kosemdocs
ReferenceAPIAgent usage

Query agent usage in organization

Sums what an organization's or a project's agents used over a range of days in UTC, grouped as asked. Private agents count too.

GET
/v1/organizations/{organization}/agent-usage

Sums what an organization's or a project's agents used over a range of days in UTC, grouped as asked. Private agents count too.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

organization*string

The organization's ID.

Match^org_[0-7][0-9a-hjkmnp-tv-z]{25}$

Query Parameters

startDate?string

The first day to sum, in UTC, such as 2026-01-31. Defaults to the first of the current month.

Formatdate
endDate?string

The last day to sum, in UTC. Defaults to today. At most 400 days after startDate.

Formatdate
groupBy?array<>

What to group the sums by: DATE, the day in UTC; PROJECT; PRINCIPAL, whom the agents worked for, who last wrote to each; AGENT. None sums them all into one row.

Response Body

OK

application/json
  1. response
rows*array<>

A row for each group, ordered by the dimensions grouped by.

Example Request
curl -X GET 'https://api.kosem.ai/v1/organizations/string/agent-usage'
Example Response
{
  "rows": [
    {
      "agent": "string",
      "agents": 0,
      "date": "2019-08-24",
      "principal": "string",
      "project": "string",
      "webSearches": 0
    }
  ]
}