- [HTTP request](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#body.request_body)
- [Response body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#body.QueryConfigurablePricingUsageStatsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#body.aspect_1)
- [TimeRange](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#TimeRange)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#TimeRange.SCHEMA_REPRESENTATION)
- [BillingMetricType](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#BillingMetricType)
- [MetricUsage](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#MetricUsage)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#MetricUsage.SCHEMA_REPRESENTATION)
- [DatedUsage](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#DatedUsage)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#DatedUsage.SCHEMA_REPRESENTATION)

Queries configurable pricing usage stats for a project.

### HTTP request

Choose an endpoint:
global us   
`GET https://discoveryengine.googleapis.com/v1alpha/{project=projects/*}/locations/{location}:queryConfigurablePricingUsageStats`

<br />

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `project` | `string` Required. The project to query usage stats for. Format: projects/{project} |
| `location` | `string` Required. The location to query usage stats for. |

### Query parameters

| Parameters ||
|---|---|
| `timeRange` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#TimeRange`)`` Optional. The time range of the usage aggregation. If endDate is not set, it defaults to current date. If startDate is not set, it defaults to 30 days prior to endDate. |
| `metricTypes[]` | ``enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#BillingMetricType`)`` Optional. The metric types to return usage for. |

### Request body

The request body must be empty.

### Response body

Response for \[ProjectService.QueryConfigurablePricingUsageStats\] method.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "metricUsages": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#MetricUsage`) } ] } ``` |

| Fields ||
|---|---|
| `metricUsages[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#MetricUsage`)`` A list of metric usages, one for each requested resource type that has data in the requested time range. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/discoveryengine.readwrite`
- `https://www.googleapis.com/auth/discoveryengine.serving.readwrite`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `project` resource:

- `discoveryengine.projects.get`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## TimeRange

The time range of the usage aggregation.

| JSON representation |
|---|
| ``` { "startDate": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/Shared.Types/Date`) }, "endDate": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/Shared.Types/Date`) } } ``` |

| Fields ||
|---|---|
| `startDate` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/Shared.Types/Date`)`` Optional. The inclusive start date of the usage aggregation. |
| `endDate` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/Shared.Types/Date`)`` Optional. The inclusive end date of the usage aggregation. |

## BillingMetricType

type of billing metric for usage stats.

| Enums ||
|---|---|
| `BILLING_METRIC_TYPE_UNSPECIFIED` | Default value. |
| `DAILY_MDN_QPM` | Daily median search request QPM. |
| `DAILY_MIN_QPM` | Daily min search request QPM. |
| `DAILY_MAX_QPM` | Daily max search request QPM. |
| `DAILY_SEARCH_REQUEST` | Daily search request total. |
| `TOTAL_STORAGE` | Total storage bytes for indexing core. |

## MetricUsage

The usage of a metric over a list of days.

| JSON representation |
|---|
| ``` { "metricType": enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#BillingMetricType`), "datedUsages": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#DatedUsage`) } ], "totalUsage": number } ``` |

| Fields ||
|---|---|
| `metricType` | ``enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#BillingMetricType`)`` The metric type. |
| `datedUsages[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations/queryConfigurablePricingUsageStats#DatedUsage`)`` The list of usages for this resource type, chronologically sorted by date. This is populated for metrics with daily aggregation like DAILY_MDN_QPM. |
| `totalUsage` | `number` The total usage for this resource type. This is populated for metrics like TOTAL_STORAGE. |

## DatedUsage

A list of usages for a specific day.

| JSON representation |
|---|
| ``` { "date": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/Shared.Types/Date`) }, "usage": number } ``` |

| Fields ||
|---|---|
| `date` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/Shared.Types/Date`)`` The date of the usage. |
| `usage` | `number` The usage value on the date. |