# Query agent usage in project

`GET /v1/projects/{project}/agent-usage`, operation `agentUsage.QueryAgentUsageInProject`

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.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | Yes | `string` | The project's ID. |
| `startDate` | query | No | `string (date)` | The first day to sum, in UTC, such as 2026-01-31. Defaults to the first of the current month. |
| `endDate` | query | No | `string (date)` | The last day to sum, in UTC. Defaults to today. At most 400 days after startDate. |
| `groupBy` | query | No | `string[]` | 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. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `rows` | `AgentUsageGroup[]` | Yes | A row for each group, ordered by the dimensions grouped by. |

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.