---
title: "Completes the [Upload](/docs/api-reference/uploads/object). Within the returned Upload object, there is a nested [File](/docs/api-reference/files/object) object that is ready to use in the rest of the platform. You can specify the order of the Parts by passing in an ordered list of the Part IDs. The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed."
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/operations/completeUpload"
---

> Full API specification: https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1.md

# Completes the [Upload](/docs/api-reference/uploads/object). Within the returned Upload object, there is a nested [File](/docs/api-reference/files/object) object that is ready to use in the rest of the platform. You can specify the order of the Parts by passing in an ordered list of the Part IDs. The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed.

`POST` `/uploads/{upload_id}/complete`

Operation ID: `completeUpload`

## Path parameters

- `upload_id` (string, required) - The ID of the Upload.

## Request body (required)

Content types: `application/json`

## Responses

- `200` - OK

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
paths:
  /uploads/{upload_id}/complete:
    post:
      operationId: completeUpload
      tags:
        - Uploads
      summary: >
        Completes the [Upload](/docs/api-reference/uploads/object). 


        Within the returned Upload object, there is a nested
        [File](/docs/api-reference/files/object) object that is ready to use in
        the rest of the platform.


        You can specify the order of the Parts by passing in an ordered list of
        the Part IDs.


        The number of bytes uploaded upon completion must match the number of
        bytes initially specified when creating the Upload object. No Parts may
        be added after an Upload is completed.
      parameters:
        - in: path
          name: upload_id
          required: true
          schema:
            type: string
            example: upload_abc123
          description: |
            The ID of the Upload.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CompleteUploadRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Upload"
      x-oaiMeta:
        name: Complete upload
        group: uploads
        returns: The [Upload](/docs/api-reference/uploads/object) object with status
          `completed` with an additional `file` property containing the created
          usable File object.
        examples:
          request:
            curl: |
              curl https://api.openai.com/v1/uploads/upload_abc123/complete
                -d '{
                  "part_ids": ["part_def456", "part_ghi789"]
                }'
          response: |
            {
              "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",
              }
            }
security:
  - ApiKeyAuth: []
components:
  schemas:
    CompleteUploadRequest:
      type: object
      additionalProperties: false
      properties:
        part_ids:
          type: array
          description: |
            The ordered list of Part IDs.
          items:
            type: string
        md5:
          description: >
            The optional md5 checksum for the file contents to verify if the
            bytes uploaded matches what you expect.
          type: string
      required:
        - part_ids
    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 was created.
        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.
        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,
            "filename": "salesOverview.pdf",
            "purpose": "assistants",
          }
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
```
