> ## 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.

# Create a movie

> Create an asynchronous movie generation job.



## OpenAPI

````yaml /openapi/keyframe.v1.yaml post /movies
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:
  /movies:
    post:
      tags:
        - Movies
      summary: Create a movie
      description: Create an asynchronous movie generation job.
      operationId: createMovie
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMovieRequest'
            examples:
              productLaunch:
                summary: Product launch film
                value:
                  prompt: >-
                    Create a cinematic 30 second launch film for a compact desk
                    lamp.
                  duration_seconds: 30
                  aspect_ratio: '16:9'
                  style: cinematic product film
                  references:
                    - reference_id: ref_abc123
                      role: product
                  webhook_url: https://example.com/webhooks/keyframe
      responses:
        '202':
          description: Movie job accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Movie'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: Unique key used to safely retry billable creation requests.
      schema:
        type: string
        minLength: 8
        maxLength: 255
  schemas:
    CreateMovieRequest:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
          minLength: 10
          maxLength: 8000
          description: Creative brief for the movie.
        duration_seconds:
          type: integer
          minimum: 5
          maximum: 120
          default: 30
          description: Target final movie duration.
        aspect_ratio:
          $ref: '#/components/schemas/AspectRatio'
        style:
          type: string
          maxLength: 1000
          description: Natural-language style direction.
        references:
          type: array
          maxItems: 20
          items:
            $ref: '#/components/schemas/MovieReferenceInput'
        webhook_url:
          type: string
          format: uri
          description: Optional HTTPS endpoint for lifecycle events.
    Movie:
      type: object
      required:
        - id
        - status
        - created_at
        - updated_at
      properties:
        id:
          type: string
          examples:
            - movie_abc123
        status:
          $ref: '#/components/schemas/MovieStatus'
        prompt:
          type: string
        duration_seconds:
          type: integer
        aspect_ratio:
          $ref: '#/components/schemas/AspectRatio'
        progress:
          type: object
          nullable: true
          properties:
            percent:
              type: integer
              minimum: 0
              maximum: 100
            stage:
              type: string
        error:
          allOf:
            - $ref: '#/components/schemas/ErrorObject'
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    AspectRatio:
      type: string
      enum:
        - '16:9'
        - '9:16'
        - '1:1'
        - '4:5'
    MovieReferenceInput:
      type: object
      required:
        - reference_id
        - role
      properties:
        reference_id:
          type: string
          examples:
            - ref_abc123
        role:
          $ref: '#/components/schemas/ReferenceRole'
        description:
          type: string
          maxLength: 1000
          description: Per-movie usage instructions for this reference.
    MovieStatus:
      type: string
      enum:
        - queued
        - planning
        - generating
        - rendering
        - completed
        - failed
        - canceled
    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
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorObject'
    ReferenceRole:
      type: string
      enum:
        - character
        - product
        - location
        - style
        - audio
        - document
        - other
  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

````