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) andlaunchpad(hosted apps). New products appear as newproductvalues, 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_atstringrequiredThe report starts on the UTC day this time falls on (RFC 3339).
ending_atstringoptionalThe 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[]optionalSplit each day's results by product, by workspace, or both. Without it, each day has a single total.
productworkspace_idlimitintegeroptionalDefault 7Days (buckets) per page, 1 to 31.
pagestringoptionalThe next_page of the previous response. Send it with the same other
parameters.
Unknown query parameters are rejected with 400.
Response
dataobject[]optionalOne bucket per UTC day of the page, oldest first, including days without cost.
data[].type'cost_bucket'optionalAlways cost_bucket.
data[].starting_atstringoptionalThe start of the day, 00:00:00Z (RFC 3339).
data[].ending_atstringoptionalThe start of the next day (RFC 3339).
data[].resultsobject[]optionalThe day's cost, one item per group. Empty for a day without cost.
data[].results[].productstring | nulloptionalserverless or launchpad, more as products are added. null unless
grouped by product.
data[].results[].workspace_idstring | nulloptionalThe workspace's ID. null unless grouped by workspace_id.
data[].results[].amountstringoptionalWhat 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_amountstringoptionalThe part of amount paid with perks.
Launchpad is never paid with perks.
data[].results[].balance_amountstringoptionalThe part of amount charged to your balance.
data[].results[].currency'USD'optionalAlways USD.
has_morebooleanoptionaltrue when the report has more days after this page.
next_pagestring | nulloptionalPass it as page to get the next days; null on the last page.
The Cost page in the Console shows the same report.
Errors
| Status | Reason |
|---|---|
400 | starting_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. |