> ## 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

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

<Info>
  Remember that we will be using the `galtea` object. More information [here](/sdk/api/galtea).
</Info>

## 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](/sdk/api/metric/create)
* [Listing Metrics](/sdk/api/metric/list)
* [Retrieving Metric](/sdk/api/metric/get)
* [Retrieving Metric By Name](/sdk/api/metric/get-by-name)
* [Deleting Metric](/sdk/api/metric/delete)

## Related

<Card title="Metric" icon="gauge" iconType="solid" href="/concepts/metric">
  Ways to evaluate and score product performance
</Card>
