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

# Upload a reference or source video

> Uploads an MP4 or MOV video (up to 100 MB and 60 seconds) to use as a reference clip or as the
video to edit. Returns a `video_id` to pass in `reference_video_ids` or as `source_video_id`.
Requires a valid `X-API-KEY` header.

Throws:
- 400 if the file is not an MP4 or MOV video, has no video stream, or is longer than 60 seconds
- 413 if the file is larger than 100 MB



## OpenAPI

````yaml POST /video/upload
openapi: 3.1.0
info:
  title: Wondercraft Public API
  version: 0.0.1
servers:
  - url: https://api.wondercraft.ai/v1
    description: Base Wondercraft API
security: []
paths:
  /video/upload:
    post:
      tags:
        - Videos
      summary: Upload a reference or source video
      description: >-
        Uploads an MP4 or MOV video (up to 100 MB and 60 seconds) to use as a
        reference clip or as the

        video to edit. Returns a `video_id` to pass in `reference_video_ids` or
        as `source_video_id`.

        Requires a valid `X-API-KEY` header.


        Throws:

        - 400 if the file is not an MP4 or MOV video, has no video stream, or is
        longer than 60 seconds

        - 413 if the file is larger than 100 MB
      operationId: upload_video_video_upload_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_video_video_upload_post'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadVideoResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    Body_upload_video_video_upload_post:
      properties:
        video:
          type: string
          format: binary
          title: Video
          description: MP4 or MOV video, up to 100 MB and 60 seconds
      type: object
      required:
        - video
      title: Body_upload_video_video_upload_post
    UploadVideoResponse:
      properties:
        video_id:
          type: string
          format: uuid
          title: Video Id
          description: Pass as `reference_video_ids` or `source_video_id` when generating
        duration_ms:
          type: integer
          title: Duration Ms
          description: Video length in milliseconds
        width:
          type: integer
          title: Width
          description: Video width in pixels
        height:
          type: integer
          title: Height
          description: Video height in pixels
      type: object
      required:
        - video_id
        - duration_ms
        - width
        - height
      title: UploadVideoResponse
    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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.