## List `client.V1.Usage.List(ctx, params) (*V1UsageListResponse, error)` **post** `/v1/usage` Fetch aggregated usage data for multiple customers and billable-metrics, broken into intervals of the specified length. ### Parameters - **params:** `V1UsageListParams` - **EndingBefore:** `param.Field[Time]` Body param: - **StartingOn:** `param.Field[Time]` Body param: - **WindowSize:** `param.Field[V1UsageListParamsWindowSize]` Body param: A window_size of "day" or "hour" will return the usage for the specified period segmented into daily or hourly aggregates. A window_size of "none" will return a single usage aggregate for the entirety of the specified period. - `V1UsageListParamsWindowSize` - `V1UsageListParamsWindowSize` - `V1UsageListParamsWindowSize` - **NextPage:** `param.Field[string]` Query param: Cursor that indicates where the next page of results should start. - **BillableMetrics:** `param.Field[[]V1UsageListParamsBillableMetric]` Body param: A list of billable metrics to fetch usage for. If absent, all billable metrics will be returned. - **ID:** `string` - **GroupBy:** `V1UsageListParamsBillableMetricsGroupBy` - **Key:** `string` The name of the group_by key to use - **Values:** `[]string` Values of the group_by key to return in the query. If this field is omitted, all available values will be returned, up to a maximum of 200. - **CustomerIDs:** `param.Field[[]string]` Body param: A list of Metronome customer IDs to fetch usage for. If absent, usage for all customers will be returned. ### Returns - Not supported - **Data:** `[]V1UsageListResponseData` - **BillableMetricID:** `string` - **BillableMetricName:** `string` - **CustomerID:** `string` - **EndTimestamp:** `Time` - **StartTimestamp:** `Time` - **Value:** `float64` - **Groups:** `map[string, float64]` Values will be either a number or null. Null indicates that there were no matches for the group_by value. - **NextPage:** `string` ### Example ```go package main import ( "context" "fmt" "time" "github.com/Metronome-Industries/metronome-go" "github.com/Metronome-Industries/metronome-go/option" ) func main() { client := metronome.NewClient( option.WithBearerToken("My Bearer Token"), ) usages, err := client.V1.Usage.List(context.TODO(), metronome.V1UsageListParams{ EndingBefore: metronome.F(time.Now()), StartingOn: metronome.F(time.Now()), WindowSize: metronome.F(metronome.V1UsageListParamsWindowSize("day")), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", usages.Data) } ```