ruby/resources/uploads/subresources/parts/index.md +0 −94 deleted
File Deleted View Diff
1# Parts
2
3## Add upload part
4
5`uploads.parts.create(upload_id, **kwargs) -> UploadPart`
6
7**post** `/uploads/{upload_id}/parts`
8
9Adds a [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) to an [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object. A Part represents a chunk of bytes from the file you are trying to upload.
10
11Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB.
12
13It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete).
14
15### Parameters
16
17- `upload_id: String`
18
19- `data: String`
20
21 The chunk of bytes for this Part.
22
23### Returns
24
25- `class UploadPart`
26
27 The upload Part represents a chunk of bytes we can add to an Upload object.
28
29 - `id: String`
30
31 The upload Part unique identifier, which can be referenced in API endpoints.
32
33 - `created_at: Integer`
34
35 The Unix timestamp (in seconds) for when the Part was created.
36
37 - `object: :"upload.part"`
38
39 The object type, which is always `upload.part`.
40
41 - `:"upload.part"`
42
43 - `upload_id: String`
44
45 The ID of the Upload object that this Part was added to.
46
47### Example
48
49```ruby
50require "openai"
51
52openai = OpenAI::Client.new(api_key: "My API Key")
53
54upload_part = openai.uploads.parts.create("upload_abc123", data: StringIO.new("Example data"))
55
56puts(upload_part)
57```
58
59#### Response
60
61```json
62{
63 "id": "id",
64 "created_at": 0,
65 "object": "upload.part",
66 "upload_id": "upload_id"
67}
68```
69
70## Domain Types
71
72### Upload Part
73
74- `class UploadPart`
75
76 The upload Part represents a chunk of bytes we can add to an Upload object.
77
78 - `id: String`
79
80 The upload Part unique identifier, which can be referenced in API endpoints.
81
82 - `created_at: Integer`
83
84 The Unix timestamp (in seconds) for when the Part was created.
85
86 - `object: :"upload.part"`
87
88 The object type, which is always `upload.part`.
89
90 - `:"upload.part"`
91
92 - `upload_id: String`
93
94 The ID of the Upload object that this Part was added to.