go/resources/fine_tuning/subresources/checkpoints/index.md +0 −400 deleted
File Deleted View Diff
1# Checkpoints
2
3# Permissions
4
5## List checkpoint permissions
6
7`client.FineTuning.Checkpoints.Permissions.Get(ctx, fineTunedModelCheckpoint, query) (*FineTuningCheckpointPermissionGetResponse, error)`
8
9**get** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`
10
11**NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
12
13Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.
14
15### Parameters
16
17- `fineTunedModelCheckpoint string`
18
19- `query FineTuningCheckpointPermissionGetParams`
20
21 - `After param.Field[string]`
22
23 Identifier for the last permission ID from the previous pagination request.
24
25 - `Limit param.Field[int64]`
26
27 Number of permissions to retrieve.
28
29 - `Order param.Field[FineTuningCheckpointPermissionGetParamsOrder]`
30
31 The order in which to retrieve permissions.
32
33 - `const FineTuningCheckpointPermissionGetParamsOrderAscending FineTuningCheckpointPermissionGetParamsOrder = "ascending"`
34
35 - `const FineTuningCheckpointPermissionGetParamsOrderDescending FineTuningCheckpointPermissionGetParamsOrder = "descending"`
36
37 - `ProjectID param.Field[string]`
38
39 The ID of the project to get permissions for.
40
41### Returns
42
43- `type FineTuningCheckpointPermissionGetResponse struct{…}`
44
45 - `Data []FineTuningCheckpointPermissionGetResponseData`
46
47 - `ID string`
48
49 The permission identifier, which can be referenced in the API endpoints.
50
51 - `CreatedAt int64`
52
53 The Unix timestamp (in seconds) for when the permission was created.
54
55 - `Object CheckpointPermission`
56
57 The object type, which is always "checkpoint.permission".
58
59 - `const CheckpointPermissionCheckpointPermission CheckpointPermission = "checkpoint.permission"`
60
61 - `ProjectID string`
62
63 The project identifier that the permission is for.
64
65 - `HasMore bool`
66
67 - `Object List`
68
69 - `const ListList List = "list"`
70
71 - `FirstID string`
72
73 - `LastID string`
74
75### Example
76
77```go
78package main
79
80import (
81 "context"
82 "fmt"
83
84 "github.com/openai/openai-go"
85 "github.com/openai/openai-go/option"
86)
87
88func main() {
89 client := openai.NewClient(
90 option.WithAPIKey("My API Key"),
91 )
92 permission, err := client.FineTuning.Checkpoints.Permissions.Get(
93 context.TODO(),
94 "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
95 openai.FineTuningCheckpointPermissionGetParams{
96
97 },
98 )
99 if err != nil {
100 panic(err.Error())
101 }
102 fmt.Printf("%+v\n", permission.FirstID)
103}
104```
105
106#### Response
107
108```json
109{
110 "data": [
111 {
112 "id": "id",
113 "created_at": 0,
114 "object": "checkpoint.permission",
115 "project_id": "project_id"
116 }
117 ],
118 "has_more": true,
119 "object": "list",
120 "first_id": "first_id",
121 "last_id": "last_id"
122}
123```
124
125## List checkpoint permissions
126
127`client.FineTuning.Checkpoints.Permissions.List(ctx, fineTunedModelCheckpoint, query) (*ConversationCursorPage[FineTuningCheckpointPermissionListResponse], error)`
128
129**get** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`
130
131**NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
132
133Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.
134
135### Parameters
136
137- `fineTunedModelCheckpoint string`
138
139- `query FineTuningCheckpointPermissionListParams`
140
141 - `After param.Field[string]`
142
143 Identifier for the last permission ID from the previous pagination request.
144
145 - `Limit param.Field[int64]`
146
147 Number of permissions to retrieve.
148
149 - `Order param.Field[FineTuningCheckpointPermissionListParamsOrder]`
150
151 The order in which to retrieve permissions.
152
153 - `const FineTuningCheckpointPermissionListParamsOrderAscending FineTuningCheckpointPermissionListParamsOrder = "ascending"`
154
155 - `const FineTuningCheckpointPermissionListParamsOrderDescending FineTuningCheckpointPermissionListParamsOrder = "descending"`
156
157 - `ProjectID param.Field[string]`
158
159 The ID of the project to get permissions for.
160
161### Returns
162
163- `type FineTuningCheckpointPermissionListResponse struct{…}`
164
165 The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.
166
167 - `ID string`
168
169 The permission identifier, which can be referenced in the API endpoints.
170
171 - `CreatedAt int64`
172
173 The Unix timestamp (in seconds) for when the permission was created.
174
175 - `Object CheckpointPermission`
176
177 The object type, which is always "checkpoint.permission".
178
179 - `const CheckpointPermissionCheckpointPermission CheckpointPermission = "checkpoint.permission"`
180
181 - `ProjectID string`
182
183 The project identifier that the permission is for.
184
185### Example
186
187```go
188package main
189
190import (
191 "context"
192 "fmt"
193
194 "github.com/openai/openai-go"
195 "github.com/openai/openai-go/option"
196)
197
198func main() {
199 client := openai.NewClient(
200 option.WithAPIKey("My API Key"),
201 )
202 page, err := client.FineTuning.Checkpoints.Permissions.List(
203 context.TODO(),
204 "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
205 openai.FineTuningCheckpointPermissionListParams{
206
207 },
208 )
209 if err != nil {
210 panic(err.Error())
211 }
212 fmt.Printf("%+v\n", page)
213}
214```
215
216#### Response
217
218```json
219{
220 "data": [
221 {
222 "id": "id",
223 "created_at": 0,
224 "object": "checkpoint.permission",
225 "project_id": "project_id"
226 }
227 ],
228 "has_more": true,
229 "object": "list",
230 "first_id": "first_id",
231 "last_id": "last_id"
232}
233```
234
235## Create checkpoint permissions
236
237`client.FineTuning.Checkpoints.Permissions.New(ctx, fineTunedModelCheckpoint, body) (*Page[FineTuningCheckpointPermissionNewResponse], error)`
238
239**post** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`
240
241**NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys).
242
243This enables organization owners to share fine-tuned models with other projects in their organization.
244
245### Parameters
246
247- `fineTunedModelCheckpoint string`
248
249- `body FineTuningCheckpointPermissionNewParams`
250
251 - `ProjectIDs param.Field[[]string]`
252
253 The project identifiers to grant access to.
254
255### Returns
256
257- `type FineTuningCheckpointPermissionNewResponse struct{…}`
258
259 The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.
260
261 - `ID string`
262
263 The permission identifier, which can be referenced in the API endpoints.
264
265 - `CreatedAt int64`
266
267 The Unix timestamp (in seconds) for when the permission was created.
268
269 - `Object CheckpointPermission`
270
271 The object type, which is always "checkpoint.permission".
272
273 - `const CheckpointPermissionCheckpointPermission CheckpointPermission = "checkpoint.permission"`
274
275 - `ProjectID string`
276
277 The project identifier that the permission is for.
278
279### Example
280
281```go
282package main
283
284import (
285 "context"
286 "fmt"
287
288 "github.com/openai/openai-go"
289 "github.com/openai/openai-go/option"
290)
291
292func main() {
293 client := openai.NewClient(
294 option.WithAPIKey("My API Key"),
295 )
296 page, err := client.FineTuning.Checkpoints.Permissions.New(
297 context.TODO(),
298 "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
299 openai.FineTuningCheckpointPermissionNewParams{
300 ProjectIDs: []string{"string"},
301 },
302 )
303 if err != nil {
304 panic(err.Error())
305 }
306 fmt.Printf("%+v\n", page)
307}
308```
309
310#### Response
311
312```json
313{
314 "data": [
315 {
316 "id": "id",
317 "created_at": 0,
318 "object": "checkpoint.permission",
319 "project_id": "project_id"
320 }
321 ],
322 "has_more": true,
323 "object": "list",
324 "first_id": "first_id",
325 "last_id": "last_id"
326}
327```
328
329## Delete checkpoint permission
330
331`client.FineTuning.Checkpoints.Permissions.Delete(ctx, fineTunedModelCheckpoint, permissionID) (*FineTuningCheckpointPermissionDeleteResponse, error)`
332
333**delete** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}`
334
335**NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
336
337Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint.
338
339### Parameters
340
341- `fineTunedModelCheckpoint string`
342
343- `permissionID string`
344
345### Returns
346
347- `type FineTuningCheckpointPermissionDeleteResponse struct{…}`
348
349 - `ID string`
350
351 The ID of the fine-tuned model checkpoint permission that was deleted.
352
353 - `Deleted bool`
354
355 Whether the fine-tuned model checkpoint permission was successfully deleted.
356
357 - `Object CheckpointPermission`
358
359 The object type, which is always "checkpoint.permission".
360
361 - `const CheckpointPermissionCheckpointPermission CheckpointPermission = "checkpoint.permission"`
362
363### Example
364
365```go
366package main
367
368import (
369 "context"
370 "fmt"
371
372 "github.com/openai/openai-go"
373 "github.com/openai/openai-go/option"
374)
375
376func main() {
377 client := openai.NewClient(
378 option.WithAPIKey("My API Key"),
379 )
380 permission, err := client.FineTuning.Checkpoints.Permissions.Delete(
381 context.TODO(),
382 "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
383 "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
384 )
385 if err != nil {
386 panic(err.Error())
387 }
388 fmt.Printf("%+v\n", permission.ID)
389}
390```
391
392#### Response
393
394```json
395{
396 "id": "id",
397 "deleted": true,
398 "object": "checkpoint.permission"
399}
400```