> This page is for version v2 API (default).
> For other versions, use one of these documentation indexes:
> - v2 API (default): https://docs.cohere.com/v2/llms.txt
> - v1 API: https://docs.cohere.com/v1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cohere.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cohere.com/_mcp/server.

# Retrieve training metrics for fine-tuned models.

GET https://api.cohere.com/v1/finetuning/finetuned-models/{finetuned_model_id}/training-step-metrics

Returns a list of metrics measured during the training of a fine-tuned model.
The metrics are ordered by step number, with the most recent step first.
The list can be paginated using `page_size` and `page_token` parameters.

Reference: https://docs.cohere.com/reference/listtrainingstepmetrics

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `finetuned_model_id` (string, required) — The parent fine-tuned model ID.

### Query parameters

- `page_size` (integer, optional) — Maximum number of results to be returned by the server. If 0, defaults to 50.
- `page_token` (string, optional) — Request a specific page of the list results.

### Headers

- `X-Client-Name` (string, optional) — The name of the project that is making the request.

## Response

### 200

A successful response.

- `step_metrics` (list of TrainingStepMetrics, optional) — The metrics for each step the evaluation was run on.
- `next_page_token` (string, optional) — Pagination token to retrieve the next page of results. If the value is "", it means no further results for the request.

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, optional) — A developer-facing error message.

### 401 Unauthorized Error

Unauthorized

- `message` (string, optional) — A developer-facing error message.

### 403 Forbidden Error

Forbidden

- `message` (string, optional) — A developer-facing error message.

### 404 Not Found Error

Not Found

- `message` (string, optional) — A developer-facing error message.

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional) — A developer-facing error message.

### 503 Service Unavailable Error

Status Service Unavailable

- `message` (string, optional) — A developer-facing error message.

## Types

### TrainingStepMetrics

The evaluation metrics at a given step of the training of a fine-tuned model.

- `created_at` (string, optional) — Creation timestamp.
- `step_number` (integer, optional) — Step number.
- `metrics` (map from string to double, optional) — Map of names and values for each evaluation metrics.

## Examples

**Response**

```json
{
  "step_metrics": [
    {
      "created_at": "2024-01-15T09:30:00Z",
      "metrics": {
        "accuracy": 0.4557601809501648,
        "cross_entropy": 4.264331340789795,
        "generation_accuracy": 0.4557601809501648,
        "generation_cross_entropy": 4.264331340789795,
        "step": 0
      }
    },
    {
      "created_at": "2024-01-15T09:30:00Z",
      "step_number": 9,
      "metrics": {
        "accuracy": 0.7393720149993896,
        "cross_entropy": 0.7702581286430359,
        "generation_accuracy": 0.7393720149993896,
        "generation_cross_entropy": 0.7702581286430359,
        "step": 9
      }
    }
  ]
}
```

**SDK Code**

```java Cohere java SDK
/* (C)2024 */
package finetuning;

import com.cohere.api.Cohere;
import com.cohere.api.resources.finetuning.finetuning.types.ListTrainingStepMetricsResponse;

public class ListTrainingStepMetrics {
  public static void main(String[] args) {
    Cohere cohere = Cohere.builder().clientName("snippet").build();

    ListTrainingStepMetricsResponse response =
        cohere.finetuning().listTrainingStepMetrics("test-id");

    System.out.println(response);
  }
}

```

```go Cohere Go SDK
package main

import (
	"context"
	"log"
	"os"

	"github.com/cohere-ai/cohere-go/v2/client"
)

func main() {
	co := client.NewClient(client.WithToken(os.Getenv("CO_API_KEY")))

	resp, err := co.Finetuning.ListTrainingStepMetrics(
		context.TODO(),
		"test-finetuned-model-id",
		nil,
	)
	if err != nil {
		log.Fatal(err)
	}

	log.Printf("%+v", resp.StepMetrics)
}

```

```typescript Cohere TypeScript SDK
const { CohereClient } = require('cohere-ai');

const cohere = new CohereClient({
  token: '<<apiKey>>',
});

(async () => {
  const trainingStepMetrics = await cohere.finetuning.listTrainingStepMetrics(
    'test-finetuned-model-id'
  );

  console.log(trainingStepMetrics);
})();

```

```python Sync
import cohere

co = cohere.Client()
train_step_metrics = co.finetuning.list_training_step_metrics(
    finetuned_model_id="test-id"
)
print(train_step_metrics)

```

```python Async
import cohere
import asyncio

co = cohere.AsyncClient()


async def main():
    response = await co.finetuning.list_train_step_metrics(finetuned_model_id="test-id")
    print(response)


asyncio.run(main())

```

```ruby /finetuning_ListTrainingStepMetrics_example
require 'uri'
require 'net/http'

url = URI("https://api.cohere.com/v1/finetuning/finetuned-models/finetuned_model_id/training-step-metrics")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Client-Name"] = 'my-cool-project'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```php /finetuning_ListTrainingStepMetrics_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.cohere.com/v1/finetuning/finetuned-models/finetuned_model_id/training-step-metrics', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Client-Name' => 'my-cool-project',
  ],
]);

echo $response->getBody();
```

```csharp /finetuning_ListTrainingStepMetrics_example
using RestSharp;

var client = new RestClient("https://api.cohere.com/v1/finetuning/finetuned-models/finetuned_model_id/training-step-metrics");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Client-Name", "my-cool-project");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift /finetuning_ListTrainingStepMetrics_example
import Foundation

let headers = [
  "X-Client-Name": "my-cool-project",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cohere.com/v1/finetuning/finetuned-models/finetuned_model_id/training-step-metrics")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```