# Retrieve User Visible Metrics

Launch stage: GA

`POST /api/2.0/vector-search/endpoints/{name}/metrics`

Retrieve user-visible metrics for an endpoint

API scopes: vector-search

## Path parameters

- `name` (string, optional)
  AI Search endpoint name

## Request body

- `start_time` (string, optional)
  Start time for metrics query
- `end_time` (string, optional)
  End time for metrics query
- `granularity_in_seconds` (int32, optional)
  Granularity in seconds
- `metrics` (array of object, optional)
  List of metrics to retrieve
  - `name` (string, optional)
    Metric name
  - `labels` (array of object, optional)
    Metric labels
    - `name` (string, optional)
      Label name
    - `value` (string, optional)
      Label value
  - `percentile` (double, optional)
    Percentile for the metric
- `page_token` (string, optional)
  Token for pagination

## Returns

- `metric_values` (array of object, optional)
  Collection of metric values
  - `metric` (object, optional)
    Metric specification
    - `name` (string, optional)
      Metric name
    - `labels` (array of object, optional)
      Metric labels
      - `name` (string, optional)
        Label name
      - `value` (string, optional)
        Label value
    - `percentile` (double, optional)
      Percentile for the metric
  - `values` (array of object, optional)
    Time series of metric values
    - `timestamp` (int64, optional)
      Timestamp of the metric value (milliseconds since epoch)
    - `value` (double, optional)
      Metric value
- `next_page_token` (string, optional)
  A token that can be used to get the next page of results. If not present, there are no more results to show.

## Response

```json
{
  "metric_values": [
    {
      "metric": {},
      "values": [
        {}
      ]
    }
  ],
  "next_page_token": "string"
}
```

