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

# client.trainings.getRunMetrics()

> Get training run metrics.

Return the latest recorded value of each metric for the run, including its step and timestamp.

## Signature

Method signature on `client.trainings`:

```ts theme={null}
getRunMetrics(args: {
  trainingRunId: string;
}): Promise<TrainingRunMetrics>;
```

## Parameters

**trainingRunId** `string` *required*

ID of the training run, with prefix `trn.`.

## Returns

`Promise<TrainingRunMetrics>`

The latest value of each metric reported for this training run.

**available** `boolean` *required*

Whether metrics can currently be read for this run.

**unavailableReason** `"not_configured" | "unresolved" | null` *required*

Reason metrics are unavailable: `not_configured` when metric access is disabled or `unresolved` when the run cannot yet be found; null when available.

**truncated** `boolean` *required*

Whether metric keys or points were omitted from this response.

**metrics** `object[]` *required*

Latest available value for each metric key.

**Fields**

**key** `string` *required*

Metric key accepted by the metric-history endpoint.

**metric** `"training_loss" | "validation_loss" | "learning_rate" | "training_token_accuracy" | "validation_token_accuracy" | null` *required*

Normalized metric name, or null when this key has no recognized metric name.

**latest** `object` *required*

Latest recorded value of this metric.

See the [HTTP endpoint](https://docs.platform.toloka.ai/docs/api-reference/trainings/get-training-run-metrics.md) for the complete schema.

## Errors

HTTP errors throw [`PotatoApiError`](https://docs.platform.toloka.ai/docs/sdk/errors). The endpoint documents these error responses:

| Status | Description |
| - | - |
| 404 | Training Run not found |
| 429 | Rate limit exceeded |

HTTP endpoint: [`GET /training-runs/{trainingRunId}/metrics`](https://docs.platform.toloka.ai/docs/api-reference/trainings/get-training-run-metrics).

```ts getRunMetrics() theme={null}
import { createClient } from "@toloka-platform/sdk";

const client = createClient({
  baseUrl: "https://platform.toloka.ai",
  apiKey: process.env.TOLOKA_API_KEY!,
});

const metrics = await client.trainings.getRunMetrics({
  trainingRunId: "trn.019a0000-0000-7000-8000-000000000001"
});
console.log(metrics);
```

```json getRunMetrics() theme={null}
{
  "available": false,
  "unavailableReason": null,
  "truncated": false,
  "metrics": [
    {
      "key": "<string>",
      "metric": null,
      "latest": {
        "step": 0,
        "timestamp": 0,
        "value": null,
        "nonFinite": null
      }
    }
  ]
}
```


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