# Create a checkpoint permission

`POST /openai/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`

Creates a permission for the specified fine-tuned model checkpoint. This operation requires an admin API key.

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `fine_tuned_model_checkpoint` | `string` | Yes | The ID of the fine-tuned model checkpoint to create a permission for. |

## Request Body

Content-Type: `application/json` *(required)*

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `project_ids` | `string[]` | Yes | The project identifiers to grant access to. |

## Responses

### 200 — The request has succeeded.

Content-Type: `application/json`

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

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

**Array of** `OpenAI.FineTuningCheckpointPermission`**:**

The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The permission identifier, which can be referenced in the API endpoints. |
| `created_at` | `integer` | Yes | The Unix timestamp (in seconds) for when the permission was created. _Format:_ `unixtime` |
| `project_id` | `string` | Yes | The project identifier that the permission is for. |
| `object` | `enum` | Yes | The object type, which is always "checkpoint.permission". _Constant:_ `checkpoint.permission` |

### 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/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \
  -H "Authorization: Bearer $OPENAI_API_KEY"
  -d '{"project_ids": ["proj_abGMw1llN8IrBb6SvvY5A1iH"]}'

```

### 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 permissionCreateResponse of client.fineTuning.checkpoints.permissions.create(
  'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd',
  { project_ids: ['string'] },
)) {
  console.log(permissionCreateResponse.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.checkpoints.permissions.create(
    fine_tuned_model_checkpoint="ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
    project_ids=["string"],
)
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.Checkpoints.Permissions.New(
		context.TODO(),
		"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
		openai.FineTuningCheckpointPermissionNewParams{
			ProjectIDs: []string{"string"},
		},
	)
	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.checkpoints.permissions.PermissionCreatePage;
import com.openai.models.finetuning.checkpoints.permissions.PermissionCreateParams;

public final class Main {
    private Main() {}

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

        PermissionCreateParams params = PermissionCreateParams.builder()
            .fineTunedModelCheckpoint("ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd")
            .addProjectId("string")
            .build();
        PermissionCreatePage page = client.fineTuning().checkpoints().permissions().create(params);
    }
}
```

### Ruby

```ruby
require "openai"

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

page = openai.fine_tuning.checkpoints.permissions.create(
  "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
  project_ids: ["string"]
)

puts(page)
```

### Response

```json
{
  "object": "list",
  "data": [
    {
      "object": "checkpoint.permission",
      "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
      "created_at": 1721764867,
      "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"
    }
  ],
  "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
  "last_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
  "has_more": false
}

```
