Get usage series

usageSeries(input: UsageSeriesInput!): UsageSeries!

Requires account.billing.read.

Arguments

ArgumentTypeRequired
inputUsageSeriesInput!Yes

Input fields

input

UsageSeriesInput

FieldTypeRequiredDescription
fromStringNo
toStringNo
granularityStringNo
groupBy[String!]Noproject for resource metrics; credits also supports model, api_key and member.
compareStringNo
metricString!Yescredits, storage, bandwidth or api_calls
presetStringNo7d, 30d or 90d. Defaults to 30d.
timezoneStringNoIANA time zone for daily bucket boundaries. Defaults to UTC.
projectReferenceStringNoProject ID or slug that narrows the read to one project of the account

Response

Returns UsageSeries!. Open the type for its fields and nested types.

FieldTypeDescription
scopeCreditUsageScope
groupBy[String!]
metricString!
labelString!
unitString!Unit of the values, such as credits, calls or bytes
summaryUsageSeriesSummary!
timeframeUsageTimeframe!
series[UsageSeriesBucket!]!

All fields of UsageSeries.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
query UsageSeries($input: UsageSeriesInput!) {
  usageSeries(input: $input) {
    groupBy
    label
    metric
    unit
  }
}
json
{
  "input": {
    "metric": "example",
    "projectReference": "00000000-0000-4000-8000-000000000001"
  }
}