Skip to content

Uploads

Create upload
uploads.create(UploadCreateParams**kwargs) -> Upload
POST/uploads
Complete upload
uploads.complete(strupload_id, UploadCompleteParams**kwargs) -> Upload
POST/uploads/{upload_id}/complete
Cancel upload
uploads.cancel(strupload_id) -> Upload
POST/uploads/{upload_id}/cancel
ModelsExpand Collapse
class Upload:

The Upload object can accept byte chunks in the form of Parts.

id: str

The Upload unique identifier, which can be referenced in API endpoints.

bytes: int

The intended number of bytes to be uploaded.

created_at: int

The Unix timestamp (in seconds) for when the Upload was created.

expires_at: int

The Unix timestamp (in seconds) for when the Upload will expire.

filename: str

The name of the file to be uploaded.

object: Literal["upload"]

The object type, which is always "upload".

purpose: str

The intended purpose of the file. Please refer here for acceptable values.

status: Literal["pending", "completed", "cancelled", "expired"]

The status of the Upload.

Accepts one of the following:
"pending"
"completed"
"cancelled"
"expired"
file: Optional[FileObject]

The File object represents a document that has been uploaded to OpenAI.

UploadsParts

Add upload part
uploads.parts.create(strupload_id, PartCreateParams**kwargs) -> UploadPart
POST/uploads/{upload_id}/parts
ModelsExpand Collapse
class UploadPart:

The upload Part represents a chunk of bytes we can add to an Upload object.

id: str

The upload Part unique identifier, which can be referenced in API endpoints.

created_at: int

The Unix timestamp (in seconds) for when the Part was created.

object: Literal["upload.part"]

The object type, which is always upload.part.

upload_id: str

The ID of the Upload object that this Part was added to.