# List fine-tuning checkpoints

`GET /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints`

Returns the checkpoints for the specified fine-tuning job.

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `fine_tuning_job_id` | `string` | Yes | The ID of the fine-tuning job to get checkpoints for. |

### Query parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `after` | `string` | No | Identifier for the last checkpoint ID from the previous pagination request. |
| `limit` | `integer` | No | Number of checkpoints to retrieve. _Default:_ `10` |

## Responses

### 200 — The request has succeeded.

Content-Type: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `data` | `OpenAI.FineTuningJobCheckpoint[]` | Yes |  |
| `object` | `enum` | Yes | _Constant:_ `list` |
| `first_id` | `string \| null` | No |  |
| `last_id` | `string \| null` | No |  |
| `has_more` | `boolean` | Yes |  |

#### `data` — `OpenAI.FineTuningJobCheckpoint[]`

**Array of** `OpenAI.FineTuningJobCheckpoint`**:**

The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The checkpoint identifier, which can be referenced in the API endpoints. |
| `created_at` | `integer` | Yes | The Unix timestamp (in seconds) for when the checkpoint was created. _Format:_ `unixtime` |
| `fine_tuned_model_checkpoint` | `string` | Yes | The name of the fine-tuned checkpoint model that is created. |
| `step_number` | `OpenAI.integer` | Yes | The step number that the checkpoint was created at. _Format:_ `int64` |
| `metrics` | `OpenAI.FineTuningJobCheckpointMetrics` | Yes | Metrics at the step number during the fine-tuning job. |
| `fine_tuning_job_id` | `string` | Yes | The name of the fine-tuning job that this checkpoint was created from. |
| `object` | `enum` | Yes | The object type, which is always "fine_tuning.job.checkpoint". _Constant:_ `fine_tuning.job.checkpoint` |

##### `metrics` — `OpenAI.FineTuningJobCheckpointMetrics`

Metrics at the step number during the fine-tuning job.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `step` | `OpenAI.numeric` | No | _Format:_ `double` |
| `train_loss` | `OpenAI.numeric` | No | _Format:_ `double` |
| `train_mean_token_accuracy` | `OpenAI.numeric` | No | _Format:_ `double` |
| `valid_loss` | `OpenAI.numeric` | No | _Format:_ `double` |
| `valid_mean_token_accuracy` | `OpenAI.numeric` | No | _Format:_ `double` |
| `full_valid_loss` | `OpenAI.numeric` | No | _Format:_ `double` |
| `full_valid_mean_token_accuracy` | `OpenAI.numeric` | No | _Format:_ `double` |

### 4XX — Client error

Content-Type: `application/json`

Error response for API failures.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `error` | `OpenAI.Error` | Yes |  |

#### `error` — `OpenAI.Error`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `code` | `string \| null` | Yes |  |
| `message` | `string` | Yes |  |
| `param` | `string \| null` | No |  |
| `type` | `string` | No |  |
| `details` | `OpenAI.Error[]` | No |  |
| `additionalInfo` | `object` | No |  |
| `debugInfo` | `object` | No |  |

### 5XX — Server error

Content-Type: `application/json`

Error response for API failures.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `error` | `OpenAI.Error` | Yes |  |

#### `error` — `OpenAI.Error`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `code` | `string \| null` | Yes |  |
| `message` | `string` | Yes |  |
| `param` | `string \| null` | No |  |
| `type` | `string` | No |  |
| `details` | `OpenAI.Error[]` | No |  |
| `additionalInfo` | `object` | No |  |
| `debugInfo` | `object` | No |  |

## Code Examples

### cURL

```bash
curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/checkpoints \
  -H "Authorization: Bearer $OPENAI_API_KEY"

```

### Node.js

```javascript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const fineTuningJobCheckpoint of client.fineTuning.jobs.checkpoints.list(
  'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
)) {
  console.log(fineTuningJobCheckpoint.id);
}
```

### Python

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
page = client.fine_tuning.jobs.checkpoints.list(
    fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
)
page = page.data[0]
print(page.id)
```

### Go

```go
package main

import (
	"context"
	"fmt"

	"github.com/openai/openai-go"
	"github.com/openai/openai-go/option"
)

func main() {
	client := openai.NewClient(
		option.WithAPIKey("My API Key"),
	)
	page, err := client.FineTuning.Jobs.Checkpoints.List(
		context.TODO(),
		"ft-AF1WoRqd3aJAHsqc9NY7iL8F",
		openai.FineTuningJobCheckpointListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v
", page)
}

```

### Java

```java
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.finetuning.jobs.checkpoints.CheckpointListPage;
import com.openai.models.finetuning.jobs.checkpoints.CheckpointListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        CheckpointListPage page = client.fineTuning().jobs().checkpoints().list("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
    }
}
```

### Ruby

```ruby
require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

page = openai.fine_tuning.jobs.checkpoints.list("ft-AF1WoRqd3aJAHsqc9NY7iL8F")

puts(page)
```

### Response

```json
{
  "object": "list",
  "data": [
    {
      "object": "fine_tuning.job.checkpoint",
      "id": "ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB",
      "created_at": 1721764867,
      "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:96olL566:ckpt-step-2000",
      "metrics": {
        "full_valid_loss": 0.134,
        "full_valid_mean_token_accuracy": 0.874
      },
      "fine_tuning_job_id": "ftjob-abc123",
      "step_number": 2000
    },
    {
      "object": "fine_tuning.job.checkpoint",
      "id": "ftckpt_enQCFmOTGj3syEpYVhBRLTSy",
      "created_at": 1721764800,
      "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:7q8mpxmy:ckpt-step-1000",
      "metrics": {
        "full_valid_loss": 0.167,
        "full_valid_mean_token_accuracy": 0.781
      },
      "fine_tuning_job_id": "ftjob-abc123",
      "step_number": 1000
    }
  ],
  "first_id": "ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB",
  "last_id": "ftckpt_enQCFmOTGj3syEpYVhBRLTSy",
  "has_more": true
}

```
