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

# Upload a reference

> Upload an image, video, audio file, or document to use as generation context.



## OpenAPI

````yaml /openapi/keyframe.v1.yaml post /references
openapi: 3.1.0
info:
  title: Keyframe API
  version: 1.0.0
  summary: Create generated movies from prompts and references.
  description: |
    The Keyframe API creates generated movies from creative briefs, reference
    media, and production constraints.

    This specification describes a proposed public v1 API and may change before
    public availability.
servers:
  - url: https://api.keyframe.art/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: References
    description: Upload and manage durable reference media.
  - name: Movies
    description: Create, inspect, cancel, and retrieve movie jobs.
paths:
  /references:
    post:
      tags:
        - References
      summary: Upload a reference
      description: >-
        Upload an image, video, audio file, or document to use as generation
        context.
      operationId: uploadReference
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
                - role
              properties:
                file:
                  type: string
                  format: binary
                  description: Reference file to upload.
                role:
                  $ref: '#/components/schemas/ReferenceRole'
                description:
                  type: string
                  maxLength: 1000
                  description: How Keyframe should use this reference.
            encoding:
              file:
                contentType: >-
                  image/png, image/jpeg, image/webp, video/mp4, audio/mpeg,
                  application/pdf
      responses:
        '201':
          description: Reference uploaded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reference'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    ReferenceRole:
      type: string
      enum:
        - character
        - product
        - location
        - style
        - audio
        - document
        - other
    Reference:
      type: object
      required:
        - id
        - role
        - mime_type
        - created_at
      properties:
        id:
          type: string
          examples:
            - ref_abc123
        role:
          $ref: '#/components/schemas/ReferenceRole'
        description:
          type: string
          nullable: true
        mime_type:
          type: string
          examples:
            - image/png
        created_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorObject'
    ErrorObject:
      type: object
      required:
        - code
        - message
        - request_id
      properties:
        code:
          type: string
          examples:
            - invalid_request
        message:
          type: string
        request_id:
          type: string
          examples:
            - req_abc123
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            minimum: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````