# Query costs

`GET /v1/organizations/{organization}/costs`, operation `billingAccounts.QueryCosts`

Sums what an organization's usage costs over a range of days in UTC, grouped as asked: what was used, how much of it was free, and what the rest costs at its plan's prices.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `organization` | path | Yes | `string` | The organization'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; SKU, what is charged for. None sums them all into one row. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `rows` | `Cost[]` | Yes | A row for each group, ordered by date, then project, then SKU. |

### 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.