Retrieve project consumption metrics

Retrieves consumption metrics for Launch, Scale, Agent, and Enterprise plan projects. History begins at the time of upgrade. Results are ordered by time in ascending order (oldest to newest). Issuing a call to this API does not wake a project's compute endpoint.

Query Params
string

Specify the cursor value from the previous response to get the next batch of projects.

integer
1 to 100
Defaults to 10

Specify a value from 1 to 100 to limit number of projects in the response.

project_ids
array of strings
length between 0 and 100

Specify a list of project IDs to filter the response. If omitted, the response will contain all projects. A list of project IDs can be specified as an array of parameter values or as a comma-separated list in a single parameter value.

  • As an array of parameter values: project_ids=cold-poetry-09157238%20&project_ids=quiet-snow-71788278
  • As a comma-separated list in a single parameter value: project_ids=cold-poetry-09157238,quiet-snow-71788278
project_ids
date-time
required

Specify the start date-time for the consumption period. The date-time value is rounded according to the specified granularity. For example, 2024-03-15T15:30:00Z for daily granularity will be rounded to 2024-03-15T00:00:00Z. The specified date-time value must respect the specified granularity:

  • For hourly, consumption metrics are limited to the last 168 hours.
  • For daily, consumption metrics are limited to the last 60 days.
  • For monthly, consumption metrics are limited to the last year.

The consumption history is available starting from March 1, 2024, at 00:00:00 UTC.

date-time
required

Specify the end date-time for the consumption period. The date-time value is rounded according to the specified granularity. For example, 2024-03-15T15:30:00Z for daily granularity will be rounded to 2024-03-15T00:00:00Z. The specified date-time value must respect the specified granularity:

  • For hourly, consumption metrics are limited to the last 168 hours.
  • For daily, consumption metrics are limited to the last 60 days.
  • For monthly, consumption metrics are limited to the last year.
string
enum
required

Specify the granularity of consumption metrics. Hourly, daily, and monthly metrics are available for the last 168 hours, 60 days, and 1 year, respectively.

Allowed:
string
required

Specify the organization for which the project consumption metrics should be returned. If this parameter is not provided, the endpoint will return the metrics for the authenticated user's projects.

metrics
array of strings
required

Specify a list of metrics to include in the response. Possible values:

  • compute_unit_seconds
  • root_branch_bytes_month
  • child_branch_bytes_month
  • instant_restore_bytes_month
  • public_network_transfer_bytes
  • private_network_transfer_bytes
  • extra_branches_month
  • snapshot_storage_bytes_month

A list of metrics can be specified as an array of parameter values or as a comma-separated list in a single parameter value.

  • As an array of parameter values: metrics=compute_unit_seconds&metrics=extra_branches_month
  • As a comma-separated list in a single parameter value: metrics=compute_unit_seconds,extra_branches_month
metrics*
Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json