> ## Documentation Index
> Fetch the complete documentation index at: https://openai-hd4n6.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create upload

> Creates an intermediate [Upload](/docs/api-reference/uploads/object) object
that you can add [Parts](/docs/api-reference/uploads/part-object) 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](/docs/api-reference/files/object) 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](/docs/assistants/tools/file-search#supported-files).

For guidance on the proper filename extensions for each purpose, please
follow the documentation on [creating a
File](/docs/api-reference/files/create).




## OpenAPI

````yaml api-definition.yaml post /uploads
openapi: 3.0.0
info:
  title: OpenAI API
  description: >-
    The OpenAI REST API. Please see
    https://platform.openai.com/docs/api-reference for more details.
  version: 2.3.0
  termsOfService: https://openai.com/policies/terms-of-use
  contact:
    name: OpenAI Support
    url: https://help.openai.com/
  license:
    name: MIT
    url: https://github.com/openai/openai-openapi/blob/master/LICENSE
servers:
  - url: https://api.openai.com/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Assistants
    description: Build Assistants that can call models and use tools.
  - name: Audio
    description: Turn audio into text or text into audio.
  - name: Chat
    description: >-
      Given a list of messages comprising a conversation, the model will return
      a response.
  - name: Completions
    description: >-
      Given a prompt, the model will return one or more predicted completions,
      and can also return the probabilities of alternative tokens at each
      position.
  - name: Embeddings
    description: >-
      Get a vector representation of a given input that can be easily consumed
      by machine learning models and algorithms.
  - name: Evals
    description: Manage and run evals in the OpenAI platform.
  - name: Fine-tuning
    description: Manage fine-tuning jobs to tailor a model to your specific training data.
  - name: Batch
    description: Create large batches of API requests to run asynchronously.
  - name: Files
    description: >-
      Files are used to upload documents that can be used with features like
      Assistants and Fine-tuning.
  - name: Uploads
    description: Use Uploads to upload large files in multiple parts.
  - name: Images
    description: Given a prompt and/or an input image, the model will generate a new image.
  - name: Models
    description: List and describe the various models available in the API.
  - name: Moderations
    description: >-
      Given text and/or image inputs, classifies if those inputs are potentially
      harmful.
  - name: Audit Logs
    description: List user actions and configuration changes within this organization.
paths:
  /uploads:
    post:
      tags:
        - Uploads
      summary: Create upload
      description: >
        Creates an intermediate [Upload](/docs/api-reference/uploads/object)
        object

        that you can add [Parts](/docs/api-reference/uploads/part-object) 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](/docs/api-reference/files/object) 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](/docs/assistants/tools/file-search#supported-files).


        For guidance on the proper filename extensions for each purpose, please

        follow the documentation on [creating a

        File](/docs/api-reference/files/create).
      operationId: createUpload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUploadRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Upload'
components:
  schemas:
    CreateUploadRequest:
      type: object
      additionalProperties: false
      properties:
        filename:
          description: |
            The name of the file to upload.
          type: string
        purpose:
          description: >
            The intended purpose of the uploaded file.


            See the [documentation on File
            purposes](/docs/api-reference/files/create#files-create-purpose).
          type: string
          enum:
            - assistants
            - batch
            - fine-tune
            - vision
        bytes:
          description: |
            The number of bytes in the file you are uploading.
          type: integer
        mime_type:
          description: >
            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.
          type: string
      required:
        - filename
        - purpose
        - bytes
        - mime_type
    Upload:
      type: object
      title: Upload
      description: |
        The Upload object can accept byte chunks in the form of Parts.
      properties:
        id:
          type: string
          description: >-
            The Upload unique identifier, which can be referenced in API
            endpoints.
        created_at:
          type: integer
          description: The Unix timestamp (in seconds) for when the Upload was created.
        filename:
          type: string
          description: The name of the file to be uploaded.
        bytes:
          type: integer
          description: The intended number of bytes to be uploaded.
        purpose:
          type: string
          description: >-
            The intended purpose of the file. [Please refer
            here](/docs/api-reference/files/object#files/object-purpose) for
            acceptable values.
        status:
          type: string
          description: The status of the Upload.
          enum:
            - pending
            - completed
            - cancelled
            - expired
        expires_at:
          type: integer
          description: The Unix timestamp (in seconds) for when the Upload will expire.
        object:
          type: string
          description: The object type, which is always "upload".
          enum:
            - upload
          x-stainless-const: true
        file:
          allOf:
            - $ref: '#/components/schemas/OpenAIFile'
            - nullable: true
              description: The ready File object after the Upload is completed.
      required:
        - bytes
        - created_at
        - expires_at
        - filename
        - id
        - purpose
        - status
      x-oaiMeta:
        name: The upload object
        example: |
          {
            "id": "upload_abc123",
            "object": "upload",
            "bytes": 2147483648,
            "created_at": 1719184911,
            "filename": "training_examples.jsonl",
            "purpose": "fine-tune",
            "status": "completed",
            "expires_at": 1719127296,
            "file": {
              "id": "file-xyz321",
              "object": "file",
              "bytes": 2147483648,
              "created_at": 1719186911,
              "filename": "training_examples.jsonl",
              "purpose": "fine-tune",
            }
          }
    OpenAIFile:
      title: OpenAIFile
      description: >-
        The `File` object represents a document that has been uploaded to
        OpenAI.
      properties:
        id:
          type: string
          description: The file identifier, which can be referenced in the API endpoints.
        bytes:
          type: integer
          description: The size of the file, in bytes.
        created_at:
          type: integer
          description: The Unix timestamp (in seconds) for when the file was created.
        expires_at:
          type: integer
          description: The Unix timestamp (in seconds) for when the file will expire.
        filename:
          type: string
          description: The name of the file.
        object:
          type: string
          description: The object type, which is always `file`.
          enum:
            - file
          x-stainless-const: true
        purpose:
          type: string
          description: >-
            The intended purpose of the file. Supported values are `assistants`,
            `assistants_output`, `batch`, `batch_output`, `fine-tune`,
            `fine-tune-results` and `vision`.
          enum:
            - assistants
            - assistants_output
            - batch
            - batch_output
            - fine-tune
            - fine-tune-results
            - vision
        status:
          type: string
          deprecated: true
          description: >-
            Deprecated. The current status of the file, which can be either
            `uploaded`, `processed`, or `error`.
          enum:
            - uploaded
            - processed
            - error
        status_details:
          type: string
          deprecated: true
          description: >-
            Deprecated. For details on why a fine-tuning training file failed
            validation, see the `error` field on `fine_tuning.job`.
      required:
        - id
        - object
        - bytes
        - created_at
        - filename
        - purpose
        - status
      x-oaiMeta:
        name: The file object
        example: |
          {
            "id": "file-abc123",
            "object": "file",
            "bytes": 120000,
            "created_at": 1677610602,
            "expires_at": 1680202602,
            "filename": "salesOverview.pdf",
            "purpose": "assistants",
          }
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````