Skip to Content
kosemdocs
ReferenceAPIBilling accounts

Query costs

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.

GET
/v1/organizations/{organization}/costs

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.

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; SKU, what is charged for. None sums them all into one row.

Response Body

OK

application/json
  1. response
rows*array<>

A row for each group, ordered by date, then project, then SKU.

Example Request
curl -X GET 'https://api.kosem.ai/v1/organizations/string/costs'
Example Response
{
  "rows": [
    {
      "charged": 0,
      "cost": {
        "currencyCode": "string",
        "nanos": -999999999,
        "units": 0
      },
      "date": "2019-08-24",
      "free": 0,
      "project": "string",
      "projectDisplayName": "string",
      "sku": "string",
      "usage": 0
    }
  ]
}