> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Metrics Service

> Metrics Service API methods in the Galtea SDK

> [!WARNING]
>
> You are reading the docs of Galtea 5.16. [Read this page in the latest version](https://docs.galtea.ai/sdk/api/metric/service.md).

The Metrics Service in the Galtea SDK allows you to manage [metrics](https://docs.galtea.ai/v5.16/concepts/metric.md) for evaluating your products.
This Service is exposed by the `galtea.metrics` object.

> [!NOTE]
>
> Remember that we will be using the `galtea` object. More information [here](https://docs.galtea.ai/v5.16/sdk/api/galtea.md).

## Quick Example

First, initialize the Galtea SDK:

```python theme={"system"}
galtea = Galtea(api_key="YOUR_API_KEY")
```

Create a metric:

```python theme={"system"}
metric = galtea.metrics.create(
    name=metric_name,
    evaluator_model_name="GPT-4.1",
    source="partial_prompt",
    judge_prompt="Evaluate if the actual_output is polite.",
    evaluation_params=["input", "actual_output"],
    description="Checks politeness",
)
```

List all metrics:

```python theme={"system"}
metrics = galtea.metrics.list(limit=20)
```

Get a metric by name:

```python theme={"system"}
metric = galtea.metrics.get_by_name(name=metric_name)
```

## Service Methods

* [Create Metric](https://docs.galtea.ai/v5.16/sdk/api/metric/create.md)
* [Listing Metrics](https://docs.galtea.ai/v5.16/sdk/api/metric/list.md)
* [Retrieving Metric](https://docs.galtea.ai/v5.16/sdk/api/metric/get.md)
* [Retrieving Metric By Name](https://docs.galtea.ai/v5.16/sdk/api/metric/get-by-name.md)
* [Deleting Metric](https://docs.galtea.ai/v5.16/sdk/api/metric/delete.md)
* [Setting Analytics Exclusion](https://docs.galtea.ai/v5.16/sdk/api/metric/set-analytics-exclusion.md)
* [Getting Analytics Exclusion Impact](https://docs.galtea.ai/v5.16/sdk/api/metric/get-analytics-exclusion-impact.md)

## Related

> [card] [Metric](https://docs.galtea.ai/v5.16/concepts/metric.md)
>
> Ways to evaluate and score product performance


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.