Uploads

Create upload

Creates an intermediate Upload object that you can add Parts to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you create it.

Once you complete the Upload, we will create a File object that contains all the parts you uploaded. This File is usable in the rest of our platform as a regular File object.

For certain purpose values, the correct mime_type must be specified. Please refer to documentation for the supported MIME types for your use case.

For guidance on the proper filename extensions for each purpose, please follow the documentation on creating a File.

Returns the Upload object with status pending.

post/uploads

Request body

filenamestring required

The name of the file to upload.

purpose'assistants' | 'batch' | 'fine-tune' | 'vision' required

The intended purpose of the uploaded file.

See the documentation on File purposes.

bytesinteger required

The number of bytes in the file you are uploading.

mime_typestring required

The MIME type of the file.

This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision.

Response

OK

idstring required

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

created_atinteger required

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

filenamestring required

The name of the file to be uploaded.

bytesinteger required

The intended number of bytes to be uploaded.

purposestring required

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

status'pending' | 'completed' | 'cancelled' | 'expired' required

The status of the Upload.

expires_atinteger required

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

object'upload'

The object type, which is always "upload".

Changes

Changed in 9 of the 164 revisions of this API.17325

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

  • 74cbcf73838f11See the full diff
    • ●

      added the new user_data enum value to the // response property for the response status

      response-property-enum-value-added

    • ○

      added the new optional request property

      new-optional-request-property

    This revision also has 40 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

  • fc164a27fdb9711See the full diff
    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ●

      removed the optional property / from the response with the status

      response-optional-property-removed

    • ○

      added subschema #2 to the response property allOf list for the response status

      response-property-all-of-added

  • 15156e46769c19See the full diff
    • ▲

      the response property became nullable for the status

      response-property-became-nullable

    • ○

      added the optional property / to the response with the status

      response-optional-property-added

    • ○

      removed subschema #2 from the response property allOf list for the response status

      response-property-all-of-removed

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

  • bdebcdfcbbde711See the full diff
    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ▲

      removed the required property / from the response with the status

      response-required-property-removed

    • ●

      removed the optional property / from the response with the status

      response-optional-property-removed

    • ○

      added subschema #2 to the response property allOf list for the response status

      response-property-all-of-added

    • ▲

      the response property became optional for the status

      response-property-became-optional

    • ○

      the response property became required for the status

      response-property-became-required

  • bddc980d3fbb19See the full diff
    • ▲

      the response's property type changed from object to no type for status

      response-property-type-changed

    • ○

      the request property format was generalized from binary to no format

      request-property-type-generalized

    • ○

      added the optional property / to the response with the status

      response-optional-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added

    • ○

      added the required property / to the response with the status

      response-required-property-added