Skip to content

Uploads

Create upload
Upload uploads().create(UploadCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/uploads
Complete upload
Upload uploads().complete(UploadCompleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/uploads/{upload_id}/complete
Cancel upload
Upload uploads().cancel(UploadCancelParamsparams = UploadCancelParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/uploads/{upload_id}/cancel
ModelsExpand Collapse
class Upload:

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

String id

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

long bytes

The intended number of bytes to be uploaded.

long createdAt

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

long expiresAt

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

String filename

The name of the file to be uploaded.

JsonValue; object_ "upload"constant"upload"constant

The object type, which is always "upload".

String purpose

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

Status status

The status of the Upload.

Accepts one of the following:
PENDING("pending")
COMPLETED("completed")
CANCELLED("cancelled")
EXPIRED("expired")
Optional<FileObject> file

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

UploadsParts

Add upload part
UploadPart uploads().parts().create(PartCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/uploads/{upload_id}/parts
ModelsExpand Collapse
class UploadPart:

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

String id

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

long createdAt

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

JsonValue; object_ "upload.part"constant"upload.part"constant

The object type, which is always upload.part.

String uploadId

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