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

# Reference-to-Video

> Reference-to-Video - Generate video based on multiple reference images

This is the **HappyHorse Video API** reference-to-video interface, generating videos based on multiple reference images.


## OpenAPI

````yaml openapi/en/happyhorse-reference-to-video.json POST /happyhorse/api/v1/services/aigc/video-generation/video-synthesis
openapi: 3.1.0
info:
  title: HappyHorse Reference-to-Video API
  version: 1.0.0
  description: >-
    HappyHorse Reference-to-Video API - Generate video based on multiple
    reference images
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /happyhorse/api/v1/services/aigc/video-generation/video-synthesis:
    post:
      description: Reference-to-Video - Generate video based on multiple reference images
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReferenceToVideoRequest'
      responses:
        '200':
          $ref: '#/components/responses/HappyHorseSuccessResponse'
          description: Success Response
      security:
        - CustomApiKey: []
components:
  schemas:
    ReferenceToVideoRequest:
      type: object
      properties:
        model:
          type: string
          description: Model name. Supports happyhorse-1.0-r2v and happyhorse-1.1-r2v.
          default: happyhorse-1.0-r2v
          example: happyhorse-1.0-r2v
          enum:
            - happyhorse-1.0-r2v
            - happyhorse-1.1-r2v
        input:
          type: object
          description: Basic input information, including reference images and prompt.
          properties:
            prompt:
              type: string
              description: >-
                Text prompt, used to describe the expected elements and visual
                characteristics in the generated video. Supports any language
                input, with a maximum length of 5000 non-Chinese characters or
                2500 Chinese characters. Exceeding content will be automatically
                truncated. Reference notation: Use character1, character2
                identifiers in prompt to refer to reference images at
                corresponding positions in the media array, in the same order as
                the media array.
            media:
              type: array
              description: >-
                Media list, used to specify reference images. Each element in
                the array is a media object containing type and url fields.
                Defines the order of character references in prompt according to
                array order. The 1st reference_image corresponds to character1,
                the 2nd to character2, and so on. Reference image count: 1 to 9
                images.
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: 'Media type. Fixed value: reference_image.'
                    enum:
                      - reference_image
                    example: reference_image
                  url:
                    type: string
                    description: >-
                      URL address of the image file, must be a publicly
                      accessible URL. Supports HTTP or HTTPS protocol. Image
                      limits: format: JPEG, JPG, PNG, WEBP; resolution: short
                      side not less than 400 pixels, recommend 720P or above
                      clear images, avoid passing images that are too small,
                      blurry, or overly compressed; file size: not exceeding
                      10MB.
                required:
                  - type
                  - url
          required:
            - prompt
            - media
        parameters:
          type: object
          description: >-
            Video generation parameters, such as setting video resolution,
            aspect ratio, duration, etc.
          properties:
            resolution:
              type: string
              description: Resolution level of generated video.
              default: 1080P
              enum:
                - 720P
                - 1080P
              example: 720P
            ratio:
              type: string
              description: Aspect ratio of generated video.
              default: '16:9'
              enum:
                - '16:9'
                - '9:16'
                - '3:4'
                - '4:3'
                - '1:1'
              example: '16:9'
            duration:
              type: integer
              description: >-
                Duration of generated video in seconds. Value range: integer
                between 3 and 15. Default: 5.
              default: 5
              minimum: 3
              maximum: 15
              example: 5
            watermark:
              type: boolean
              description: >-
                Whether to add watermark to generated video. Watermark is
                located at the bottom right corner of video, text is fixed as
                "Happy Horse". true: default, add watermark; false: no
                watermark.
              default: true
              example: false
            seed:
              type: integer
              description: >-
                Random seed, value range: [0, 2147483647]. If not specified,
                system will automatically generate a random seed. To improve
                reproducibility of generation results, it is recommended to fix
                the seed value. Note that due to the probabilistic nature of
                model generation, even with the same seed, cannot guarantee
                identical results each time.
              minimum: 0
              maximum: 2147483647
              example: 12345
      required:
        - model
        - input
  responses:
    HappyHorseSuccessResponse:
      description: Request successful
      content:
        application/json:
          schema:
            type: object
            properties:
              output:
                type: object
                description: Task output information
                properties:
                  task_status:
                    type: string
                    description: Task status
                    enum:
                      - PENDING
                      - RUNNING
                      - SUCCEEDED
                      - FAILED
                      - CANCELED
                      - UNKNOWN
                    example: PENDING
                  task_id:
                    type: string
                    description: Task ID. Valid for 24 hours.
                    example: 0385dc79-5ff8-4d82-bcb6-xxxxxx
              request_id:
                type: string
                description: >-
                  Request unique identifier. Can be used for request tracing and
                  troubleshooting.
                example: 4909100c-7b5a-9f92-bfe5-xxxxxx
            example:
              output:
                task_status: PENDING
                task_id: 0385dc79-5ff8-4d82-bcb6-xxxxxx
              request_id: 4909100c-7b5a-9f92-bfe5-xxxxxx
            required:
              - output
              - request_id
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        Please go to <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI
        Console</a> to get the API key.

````