Stability AI Image to Video API

Generate short video clips from a single input image using the Stable Video Diffusion model. The API uses an asynchronous start-and-poll pattern.

OpenAPI Specification

stability-ai-image-to-video-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Stability AI Stable Fast 3D 3D Generation Image to Video API
  description: The Stability AI Stable Fast 3D API generates textured 3D mesh assets from single input images. The API rapidly produces 3D models suitable for use in games, augmented reality, virtual reality, and product visualization workflows. Developers can convert 2D images into fully textured 3D objects with UV-unwrapped meshes, enabling rapid prototyping and asset creation without manual 3D modeling.
  version: v2beta
  contact:
    name: Stability AI Support
    url: https://platform.stability.ai
  termsOfService: https://stability.ai/terms-of-service
servers:
- url: https://api.stability.ai
  description: Production Server
security:
- bearerAuth: []
tags:
- name: Image to Video
  description: Generate short video clips from a single input image using the Stable Video Diffusion model. The API uses an asynchronous start-and-poll pattern.
paths:
  /v2beta/image-to-video:
    post:
      operationId: startImageToVideo
      summary: Start an image-to-video generation
      description: Initiates an asynchronous video generation from a single input image. Returns a generation ID that can be used to poll for the completed video. The model produces a short animated sequence with realistic motion derived from the input image. Parameters control the strength of motion and conditioning.
      tags:
      - Image to Video
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ImageToVideoRequest'
      responses:
        '200':
          description: Video generation started successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncGenerationResponse'
        '400':
          description: Bad request due to invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized due to missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2beta/image-to-video/result/{id}:
    get:
      operationId: getImageToVideoResult
      summary: Get the result of a video generation
      description: Polls for the result of an asynchronous image-to-video generation. Returns the generated video when processing is complete or a status indicating the generation is still in progress.
      tags:
      - Image to Video
      parameters:
      - $ref: '#/components/parameters/generationId'
      responses:
        '200':
          description: Video generation is complete
          content:
            video/mp4:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationResponse'
        '202':
          description: Generation is still in progress
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncGenerationResponse'
        '401':
          description: Unauthorized due to missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Generation ID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        id:
          type: string
          description: A unique identifier for the error instance.
        name:
          type: string
          description: The error type name.
        message:
          type: string
          description: A human-readable description of the error.
    ImageToVideoRequest:
      type: object
      required:
      - image
      properties:
        image:
          type: string
          format: binary
          description: The source image to animate. The image should contain a clear subject with a stable composition suitable for animation. Supported resolutions include 1024x576, 576x1024, and 768x768.
        seed:
          type: integer
          minimum: 0
          maximum: 4294967294
          default: 0
          description: A value to control randomness in the video generation.
        cfg_scale:
          type: number
          minimum: 0
          maximum: 10
          default: 1.8
          description: Controls how closely the video follows the conditioning from the input image. Higher values produce videos more faithful to the input but may reduce motion quality.
        motion_bucket_id:
          type: integer
          minimum: 1
          maximum: 255
          default: 127
          description: Controls the amount of motion in the generated video. Lower values produce less motion, higher values produce more dynamic motion.
    VideoGenerationResponse:
      type: object
      properties:
        video:
          type: string
          description: Base64-encoded video data when Accept header is set to application/json.
        finish_reason:
          type: string
          enum:
          - SUCCESS
          - CONTENT_FILTERED
          description: The reason the generation finished.
        seed:
          type: integer
          description: The seed used for generation.
    AsyncGenerationResponse:
      type: object
      properties:
        id:
          type: string
          description: The unique generation ID used to poll for results.
        status:
          type: string
          description: The current status of the generation.
  parameters:
    generationId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: The unique identifier of the asynchronous generation to poll for results.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Pass your Stability AI API key as a Bearer token in the Authorization header.
externalDocs:
  description: Stability AI API Documentation
  url: https://platform.stability.ai/docs/api-reference