# Query LLM usage in project

`GET /v1/projects/{project}/llmUsage`, operation `llmUsage.QueryLlmUsageInProject`

Sums the usage of an organization's or a project's requests to models over a range of days in UTC, grouped as asked.

## 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; MODEL; PRINCIPAL, who made the requests; SOURCE, what in kosem made them, such as an agent, which counts only the requests that a source made. None sums them all into one row. |
| `source` | query | No | `string` | Only the requests that this source made, such as an agent, projects/{project_id}/agents/{agent_id}. |
| `model` | query | No | `string` | Only the requests to this model: a project's, projects/{project_id}/models/{model_id}, or an organization's, organizations/{organization_id}/models/{model_id}, for the requests to the projects' adoptions of it. |
| `principal` | query | No | `string` | Only the requests of this caller, such as user:usr_…, serviceAccount:sa_… or agent:ags_…. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `rows` | `LlmUsage[]` | 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.