> ## Documentation Index
> Fetch the complete documentation index at: https://rendi.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Initiate a Multipart Upload

> Start uploading a local file directly to Rendi's storage. Returns a per-part list of presigned PUT URLs that you upload chunks to. See the [direct upload guide](https://docs.rendi.dev/direct-upload) for the full flow and code samples.

<Note>
  Step 1 of 3 in the direct-upload flow. See the [direct upload guide](/direct-upload) for the full flow and code samples.

  Bytes go directly to Rendi's storage. Files up to 5 TB are supported.
</Note>


## OpenAPI

````yaml POST /v1/files/init-upload
openapi: 3.1.0
info:
  title: FFmpeg Command API
  description: API for running FFmpeg in a cloud environment
  version: 1.0.0
servers:
  - url: https://api.rendi.dev
    description: Rendi - FFmpeg API
security: []
paths:
  /v1/files/init-upload:
    post:
      tags:
        - API
        - File Management
      summary: Initiate a direct multipart upload
      description: >-
        Start uploading a local file directly to Rendi's storage. Returns a
        per-part list of presigned PUT URLs that you upload chunks to. See the
        [direct upload guide](https://docs.rendi.dev/direct-upload) for the full
        flow and code samples.
      operationId: init_upload_v1_files_init_upload_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitUploadRequest'
        required: true
      responses:
        '200':
          description: Multipart upload session created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitUploadResponse'
        '401':
          description: Invalid API key
          content:
            application/json:
              example:
                detail: Invalid authorization key
        '403':
          description: Account quota exceeded or plan does not support uploads
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded
      security:
        - APIKeyHeader: []
components:
  schemas:
    InitUploadRequest:
      properties:
        filename:
          type: string
          maxLength: 255
          minLength: 1
          pattern: ^[a-zA-Z0-9_.\-]+$
          title: Filename
          description: >-
            The filename to store. Only alphanumeric characters, underscores,
            dashes, and dots are allowed.
          examples:
            - my_video.mp4
        size_bytes:
          type: integer
          maximum: 5497558138880
          exclusiveMinimum: 0
          title: Size Bytes
          description: >-
            Total size of the file in bytes. Used to size the multipart chunks
            and verify quota up front. Maximum 5 TB.
          examples:
            - 104857600
        is_private:
          type: boolean
          title: Is Private
          description: >-
            If true, the uploaded file is placed in private storage and can only
            be downloaded via a presigned URL (request one by passing
            `presigned_ttl_seconds` on the files /get endpoint). Not available
            on trial plans.
          default: false
          examples:
            - false
        part_size:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Part Size
          description: >-
            Requested per-part size in bytes. Optional. If not set, a sensible
            default is used. If the requested value is below 5 MB it's raised to
            5 MB; if above 5 GB or too small for the file to fit in the allowed
            number of parts, it's clamped accordingly. The value actually used
            is returned in the response.
          examples:
            - 10485760
      type: object
      required:
        - filename
        - size_bytes
      title: InitUploadRequest
    InitUploadResponse:
      properties:
        file_id:
          type: string
          title: File Id
          description: >-
            Unique identifier for the uploaded file. Use it in `complete-upload`
            / `abort-upload` and to poll `GET /files/{file_id}`.
          examples:
            - 987fcdeb-a89b-43d3-b456-789012345678
        part_size:
          type: integer
          title: Part Size
          description: >-
            Byte size for every part except the last (which is the remainder).
            Split your file into chunks of exactly this size and PUT each chunk
            to the matching URL in `upload_urls`.
          examples:
            - 10485760
        upload_urls:
          items:
            type: string
          type: array
          title: Upload Urls
          description: >-
            Presigned PUT URLs, one per part. Send part 1 to `upload_urls[0]`,
            part 2 to `upload_urls[1]`, and so on. Each response's `ETag` header
            must be sent back in `complete-upload`.
      type: object
      required:
        - file_id
        - part_size
        - upload_urls
      title: InitUploadResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY

````