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