# Checkpoints

# Permissions

## List checkpoint permissions

`$ openai fine-tuning:checkpoints:permissions retrieve`

**get** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`

**NOTE:** This endpoint requires an [admin API key](../admin-api-keys).

Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.

### Parameters

- `--fine-tuned-model-checkpoint: string`

  The ID of the fine-tuned model checkpoint to get permissions for.

- `--after: optional string`

  Identifier for the last permission ID from the previous pagination request.

- `--limit: optional number`

  Number of permissions to retrieve.

- `--order: optional "ascending" or "descending"`

  The order in which to retrieve permissions.

- `--project-id: optional string`

  The ID of the project to get permissions for.

### Returns

- `FineTuningCheckpointPermissionGetResponse: object { data, has_more, object, 2 more }`

  - `data: array of object { id, created_at, object, project_id }`

    - `id: string`

      The permission identifier, which can be referenced in the API endpoints.

    - `created_at: number`

      The Unix timestamp (in seconds) for when the permission was created.

    - `object: "checkpoint.permission"`

      The object type, which is always "checkpoint.permission".

    - `project_id: string`

      The project identifier that the permission is for.

  - `has_more: boolean`

  - `object: "list"`

  - `first_id: optional string`

  - `last_id: optional string`

### Example

```cli
openai fine-tuning:checkpoints:permissions retrieve \
  --api-key 'My API Key' \
  --fine-tuned-model-checkpoint ft-AF1WoRqd3aJAHsqc9NY7iL8F
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "created_at": 0,
      "object": "checkpoint.permission",
      "project_id": "project_id"
    }
  ],
  "has_more": true,
  "object": "list",
  "first_id": "first_id",
  "last_id": "last_id"
}
```

## List checkpoint permissions

`$ openai fine-tuning:checkpoints:permissions list`

**get** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`

**NOTE:** This endpoint requires an [admin API key](../admin-api-keys).

Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.

### Parameters

- `--fine-tuned-model-checkpoint: string`

  The ID of the fine-tuned model checkpoint to get permissions for.

- `--after: optional string`

  Identifier for the last permission ID from the previous pagination request.

- `--limit: optional number`

  Number of permissions to retrieve.

- `--order: optional "ascending" or "descending"`

  The order in which to retrieve permissions.

- `--project-id: optional string`

  The ID of the project to get permissions for.

### Returns

- `ListFineTuningCheckpointPermissionResponse: object { data, has_more, object, 2 more }`

  - `data: array of object { id, created_at, object, project_id }`

    - `id: string`

      The permission identifier, which can be referenced in the API endpoints.

    - `created_at: number`

      The Unix timestamp (in seconds) for when the permission was created.

    - `object: "checkpoint.permission"`

      The object type, which is always "checkpoint.permission".

    - `project_id: string`

      The project identifier that the permission is for.

  - `has_more: boolean`

  - `object: "list"`

  - `first_id: optional string`

  - `last_id: optional string`

### Example

```cli
openai fine-tuning:checkpoints:permissions list \
  --api-key 'My API Key' \
  --fine-tuned-model-checkpoint ft-AF1WoRqd3aJAHsqc9NY7iL8F
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "created_at": 0,
      "object": "checkpoint.permission",
      "project_id": "project_id"
    }
  ],
  "has_more": true,
  "object": "list",
  "first_id": "first_id",
  "last_id": "last_id"
}
```

## Create checkpoint permissions

`$ openai fine-tuning:checkpoints:permissions create`

**post** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`

**NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys).

This enables organization owners to share fine-tuned models with other projects in their organization.

### Parameters

- `--fine-tuned-model-checkpoint: string`

  The ID of the fine-tuned model checkpoint to create a permission for.

- `--project-id: array of string`

  The project identifiers to grant access to.

### Returns

- `ListFineTuningCheckpointPermissionResponse: object { data, has_more, object, 2 more }`

  - `data: array of object { id, created_at, object, project_id }`

    - `id: string`

      The permission identifier, which can be referenced in the API endpoints.

    - `created_at: number`

      The Unix timestamp (in seconds) for when the permission was created.

    - `object: "checkpoint.permission"`

      The object type, which is always "checkpoint.permission".

    - `project_id: string`

      The project identifier that the permission is for.

  - `has_more: boolean`

  - `object: "list"`

  - `first_id: optional string`

  - `last_id: optional string`

### Example

```cli
openai fine-tuning:checkpoints:permissions create \
  --api-key 'My API Key' \
  --fine-tuned-model-checkpoint ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd \
  --project-id string
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "created_at": 0,
      "object": "checkpoint.permission",
      "project_id": "project_id"
    }
  ],
  "has_more": true,
  "object": "list",
  "first_id": "first_id",
  "last_id": "last_id"
}
```

## Delete checkpoint permission

`$ openai fine-tuning:checkpoints:permissions delete`

**delete** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}`

**NOTE:** This endpoint requires an [admin API key](../admin-api-keys).

Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint.

### Parameters

- `--fine-tuned-model-checkpoint: string`

  The ID of the fine-tuned model checkpoint to delete a permission for.

- `--permission-id: string`

  The ID of the fine-tuned model checkpoint permission to delete.

### Returns

- `FineTuningCheckpointPermissionDeleteResponse: object { id, deleted, object }`

  - `id: string`

    The ID of the fine-tuned model checkpoint permission that was deleted.

  - `deleted: boolean`

    Whether the fine-tuned model checkpoint permission was successfully deleted.

  - `object: "checkpoint.permission"`

    The object type, which is always "checkpoint.permission".

### Example

```cli
openai fine-tuning:checkpoints:permissions delete \
  --api-key 'My API Key' \
  --fine-tuned-model-checkpoint ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd \
  --permission-id cp_zc4Q7MP6XxulcVzj4MZdwsAB
```

#### Response

```json
{
  "id": "id",
  "deleted": true,
  "object": "checkpoint.permission"
}
```
