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

# Text / Image to Video

> Use text or image to generate video with Haiper 1.5 model



## OpenAPI

````yaml POST /v1/jobs/generation-v2
openapi: 3.0.1
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.haiper.ai
security:
  - bearerAuth: []
paths:
  /v1/jobs/generation-v2:
    post:
      description: Use text or image to generate video with Haiper 1.5 model
      requestBody:
        description: The information to create video
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextOrImage2video1_5'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewCreation'
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TextOrImage2video1_5:
      allOf:
        - required:
            - prompt
          type: object
          properties:
            is_public:
              description: >-
                Whether is generation be public on Haiper Platform, please set
                to false if you will to keep it private. The default value is
                true
              type: boolean
            prompt:
              description: The prompt of the generation
              type: string
            negative_prompt:
              description: The negative prompt of the generation
              type: string
            config:
              properties:
                source_image:
                  description: >-
                    URL of the image (supports Base64 encoding). Supported image
                    formats include JPG, PNG, and WebP.
                  type: string
                camera_movement:
                  description: >-
                    default 'none', valid ('pan_right', 'pan_left', 'tilt_up',
                    'til_down', 'zoom_in', 'zoom_out')
                  type: string
            settings:
              type: object
              properties:
                seed:
                  description: 'Default: -1'
                  type: number
                aspect_ratio:
                  description: >-
                    The proportional relationship between the width and height
                    of the image .Default '16:9', valid: '21:9', '16:9', '9:16',
                    '3:4', '4:3', '1:1'. If source_image in the config is
                    passed, we'll take the request as image to video, the aspect
                    ratio will follow the specs from the source image, so this
                    parameter will be ignore.
                  type: string
                duration:
                  description: default 2, The duration of output video, support 2, 4 and 8
                  type: number
    NewCreation:
      required:
        - status
      type: object
      properties:
        status:
          description: ''
          type: string
        value:
          description: ''
          type: object
          properties:
            generation_id:
              description: ''
              type: string
    Error:
      required:
        - error
      type: object
      properties:
        message:
          type: string
        code:
          type: integer
          format: int32
        details:
          type: array
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````