python/resources/fine_tuning/subresources/checkpoints/index.md +0 −438 deleted
File Deleted View Diff
1# Checkpoints
2
3# Permissions
4
5## List checkpoint permissions
6
7`fine_tuning.checkpoints.permissions.retrieve(strfine_tuned_model_checkpoint, PermissionRetrieveParams**kwargs) -> PermissionRetrieveResponse`
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- `fine_tuned_model_checkpoint: str`
18
19- `after: Optional[str]`
20
21 Identifier for the last permission ID from the previous pagination request.
22
23- `limit: Optional[int]`
24
25 Number of permissions to retrieve.
26
27- `order: Optional[Literal["ascending", "descending"]]`
28
29 The order in which to retrieve permissions.
30
31 - `"ascending"`
32
33 - `"descending"`
34
35- `project_id: Optional[str]`
36
37 The ID of the project to get permissions for.
38
39### Returns
40
41- `class PermissionRetrieveResponse: …`
42
43 - `data: List[Data]`
44
45 - `id: str`
46
47 The permission identifier, which can be referenced in the API endpoints.
48
49 - `created_at: int`
50
51 The Unix timestamp (in seconds) for when the permission was created.
52
53 - `object: Literal["checkpoint.permission"]`
54
55 The object type, which is always "checkpoint.permission".
56
57 - `"checkpoint.permission"`
58
59 - `project_id: str`
60
61 The project identifier that the permission is for.
62
63 - `has_more: bool`
64
65 - `object: Literal["list"]`
66
67 - `"list"`
68
69 - `first_id: Optional[str]`
70
71 - `last_id: Optional[str]`
72
73### Example
74
75```python
76import os
77from openai import OpenAI
78
79client = OpenAI(
80 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
81)
82permission = client.fine_tuning.checkpoints.permissions.retrieve(
83 fine_tuned_model_checkpoint="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
84)
85print(permission.first_id)
86```
87
88#### Response
89
90```json
91{
92 "data": [
93 {
94 "id": "id",
95 "created_at": 0,
96 "object": "checkpoint.permission",
97 "project_id": "project_id"
98 }
99 ],
100 "has_more": true,
101 "object": "list",
102 "first_id": "first_id",
103 "last_id": "last_id"
104}
105```
106
107## List checkpoint permissions
108
109`fine_tuning.checkpoints.permissions.list(strfine_tuned_model_checkpoint, PermissionListParams**kwargs) -> SyncConversationCursorPage[PermissionListResponse]`
110
111**get** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`
112
113**NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
114
115Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.
116
117### Parameters
118
119- `fine_tuned_model_checkpoint: str`
120
121- `after: Optional[str]`
122
123 Identifier for the last permission ID from the previous pagination request.
124
125- `limit: Optional[int]`
126
127 Number of permissions to retrieve.
128
129- `order: Optional[Literal["ascending", "descending"]]`
130
131 The order in which to retrieve permissions.
132
133 - `"ascending"`
134
135 - `"descending"`
136
137- `project_id: Optional[str]`
138
139 The ID of the project to get permissions for.
140
141### Returns
142
143- `class PermissionListResponse: …`
144
145 The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.
146
147 - `id: str`
148
149 The permission identifier, which can be referenced in the API endpoints.
150
151 - `created_at: int`
152
153 The Unix timestamp (in seconds) for when the permission was created.
154
155 - `object: Literal["checkpoint.permission"]`
156
157 The object type, which is always "checkpoint.permission".
158
159 - `"checkpoint.permission"`
160
161 - `project_id: str`
162
163 The project identifier that the permission is for.
164
165### Example
166
167```python
168import os
169from openai import OpenAI
170
171client = OpenAI(
172 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
173)
174page = client.fine_tuning.checkpoints.permissions.list(
175 fine_tuned_model_checkpoint="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
176)
177page = page.data[0]
178print(page.id)
179```
180
181#### Response
182
183```json
184{
185 "data": [
186 {
187 "id": "id",
188 "created_at": 0,
189 "object": "checkpoint.permission",
190 "project_id": "project_id"
191 }
192 ],
193 "has_more": true,
194 "object": "list",
195 "first_id": "first_id",
196 "last_id": "last_id"
197}
198```
199
200## Create checkpoint permissions
201
202`fine_tuning.checkpoints.permissions.create(strfine_tuned_model_checkpoint, PermissionCreateParams**kwargs) -> SyncPage[PermissionCreateResponse]`
203
204**post** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`
205
206**NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys).
207
208This enables organization owners to share fine-tuned models with other projects in their organization.
209
210### Parameters
211
212- `fine_tuned_model_checkpoint: str`
213
214- `project_ids: Sequence[str]`
215
216 The project identifiers to grant access to.
217
218### Returns
219
220- `class PermissionCreateResponse: …`
221
222 The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.
223
224 - `id: str`
225
226 The permission identifier, which can be referenced in the API endpoints.
227
228 - `created_at: int`
229
230 The Unix timestamp (in seconds) for when the permission was created.
231
232 - `object: Literal["checkpoint.permission"]`
233
234 The object type, which is always "checkpoint.permission".
235
236 - `"checkpoint.permission"`
237
238 - `project_id: str`
239
240 The project identifier that the permission is for.
241
242### Example
243
244```python
245import os
246from openai import OpenAI
247
248client = OpenAI(
249 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
250)
251page = client.fine_tuning.checkpoints.permissions.create(
252 fine_tuned_model_checkpoint="ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
253 project_ids=["string"],
254)
255page = page.data[0]
256print(page.id)
257```
258
259#### Response
260
261```json
262{
263 "data": [
264 {
265 "id": "id",
266 "created_at": 0,
267 "object": "checkpoint.permission",
268 "project_id": "project_id"
269 }
270 ],
271 "has_more": true,
272 "object": "list",
273 "first_id": "first_id",
274 "last_id": "last_id"
275}
276```
277
278## Delete checkpoint permission
279
280`fine_tuning.checkpoints.permissions.delete(strpermission_id, PermissionDeleteParams**kwargs) -> PermissionDeleteResponse`
281
282**delete** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}`
283
284**NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
285
286Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint.
287
288### Parameters
289
290- `fine_tuned_model_checkpoint: str`
291
292- `permission_id: str`
293
294### Returns
295
296- `class PermissionDeleteResponse: …`
297
298 - `id: str`
299
300 The ID of the fine-tuned model checkpoint permission that was deleted.
301
302 - `deleted: bool`
303
304 Whether the fine-tuned model checkpoint permission was successfully deleted.
305
306 - `object: Literal["checkpoint.permission"]`
307
308 The object type, which is always "checkpoint.permission".
309
310 - `"checkpoint.permission"`
311
312### Example
313
314```python
315import os
316from openai import OpenAI
317
318client = OpenAI(
319 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
320)
321permission = client.fine_tuning.checkpoints.permissions.delete(
322 permission_id="cp_zc4Q7MP6XxulcVzj4MZdwsAB",
323 fine_tuned_model_checkpoint="ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
324)
325print(permission.id)
326```
327
328#### Response
329
330```json
331{
332 "id": "id",
333 "deleted": true,
334 "object": "checkpoint.permission"
335}
336```
337
338## Domain Types
339
340### Permission Retrieve Response
341
342- `class PermissionRetrieveResponse: …`
343
344 - `data: List[Data]`
345
346 - `id: str`
347
348 The permission identifier, which can be referenced in the API endpoints.
349
350 - `created_at: int`
351
352 The Unix timestamp (in seconds) for when the permission was created.
353
354 - `object: Literal["checkpoint.permission"]`
355
356 The object type, which is always "checkpoint.permission".
357
358 - `"checkpoint.permission"`
359
360 - `project_id: str`
361
362 The project identifier that the permission is for.
363
364 - `has_more: bool`
365
366 - `object: Literal["list"]`
367
368 - `"list"`
369
370 - `first_id: Optional[str]`
371
372 - `last_id: Optional[str]`
373
374### Permission List Response
375
376- `class PermissionListResponse: …`
377
378 The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.
379
380 - `id: str`
381
382 The permission identifier, which can be referenced in the API endpoints.
383
384 - `created_at: int`
385
386 The Unix timestamp (in seconds) for when the permission was created.
387
388 - `object: Literal["checkpoint.permission"]`
389
390 The object type, which is always "checkpoint.permission".
391
392 - `"checkpoint.permission"`
393
394 - `project_id: str`
395
396 The project identifier that the permission is for.
397
398### Permission Create Response
399
400- `class PermissionCreateResponse: …`
401
402 The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.
403
404 - `id: str`
405
406 The permission identifier, which can be referenced in the API endpoints.
407
408 - `created_at: int`
409
410 The Unix timestamp (in seconds) for when the permission was created.
411
412 - `object: Literal["checkpoint.permission"]`
413
414 The object type, which is always "checkpoint.permission".
415
416 - `"checkpoint.permission"`
417
418 - `project_id: str`
419
420 The project identifier that the permission is for.
421
422### Permission Delete Response
423
424- `class PermissionDeleteResponse: …`
425
426 - `id: str`
427
428 The ID of the fine-tuned model checkpoint permission that was deleted.
429
430 - `deleted: bool`
431
432 Whether the fine-tuned model checkpoint permission was successfully deleted.
433
434 - `object: Literal["checkpoint.permission"]`
435
436 The object type, which is always "checkpoint.permission".
437
438 - `"checkpoint.permission"`