Cost Report

What your organization spent each day, by product and workspace, and how much of it perks paid.

Get what your organization spent each day, as daily buckets in UTC, oldest first. Costs can be split by product and by workspace, and show the part paid with perks apart from the part charged to your balance.

GET /v1/organizations/cost_report
  • Products: serverless (requests to models and tools) and launchpad (hosted apps). New products appear as new product values, so treat it as an open set.
  • What counts: the cost of each request, on the UTC day it was made, plus Launchpad charges minus refunds on the day they happened. This is the same spend that spend limits count.
  • Workspaces: every workspace of the organization, archived ones included.

Query parameters

starting_atstringrequired

The report starts on the UTC day this time falls on (RFC 3339).

ending_atstringoptional

The report ends at this time (RFC 3339), rounded up to the end of its UTC day; a time at 00:00:00Z ends the report before that day. Defaults to the end of today (UTC). The report covers at most 366 days.

group_by[]string[]optional

Split each day's results by product, by workspace, or both. Without it, each day has a single total.

Allowed values:productworkspace_id
limitintegeroptionalDefault 7

Days (buckets) per page, 1 to 31.

pagestringoptional

The next_page of the previous response. Send it with the same other parameters.

Unknown query parameters are rejected with 400.

Response

dataobject[]optional

One bucket per UTC day of the page, oldest first, including days without cost.

data[].type'cost_bucket'optional

Always cost_bucket.

data[].starting_atstringoptional

The start of the day, 00:00:00Z (RFC 3339).

data[].ending_atstringoptional

The start of the next day (RFC 3339).

data[].resultsobject[]optional

The day's cost, one item per group. Empty for a day without cost.

data[].results[].productstring | nulloptional

serverless or launchpad, more as products are added. null unless grouped by product.

data[].results[].workspace_idstring | nulloptional

The workspace's ID. null unless grouped by workspace_id.

data[].results[].amountstringoptional

What was spent, in US dollars. Equal to perk_amount plus balance_amount. A Launchpad refund on a later day than its charge lowers that day's amount, which can make it negative.

data[].results[].perk_amountstringoptional

The part of amount paid with perks. Launchpad is never paid with perks.

data[].results[].balance_amountstringoptional

The part of amount charged to your balance.

data[].results[].currency'USD'optional

Always USD.

has_morebooleanoptional

true when the report has more days after this page.

next_pagestring | nulloptional

Pass it as page to get the next days; null on the last page.

The Cost page in the Console shows the same report.

Errors

StatusReason
400starting_at is missing or invalid, the report ends before it starts or spans more than 366 days, limit is out of range, page is not a next_page of this report, group_by[] has an unknown value, or a query parameter is unknown.