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

# Image-to-Video - First Frame

> Image-to-Video - Generate video based on first-frame images

This is the **HappyHorse Video API** image-to-video interface, generating videos based on first-frame images.


## OpenAPI

````yaml openapi/en/happyhorse-image-to-video.json POST /happyhorse/api/v1/services/aigc/video-generation/video-synthesis
openapi: 3.1.0
info:
  title: HappyHorse Image-to-Video API
  version: 1.0.0
  description: HappyHorse Image-to-Video API - Generate video based on first-frame images
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /happyhorse/api/v1/services/aigc/video-generation/video-synthesis:
    post:
      description: Image-to-Video - Generate video based on first-frame images
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageToVideoRequest'
      responses:
        '200':
          $ref: '#/components/responses/HappyHorseSuccessResponse'
          description: Success Response
      security:
        - CustomApiKey: []
components:
  schemas:
    ImageToVideoRequest:
      type: object
      properties:
        model:
          type: string
          description: Model name. Supports happyhorse-1.0-i2v and happyhorse-1.1-i2v.
          default: happyhorse-1.0-i2v
          example: happyhorse-1.0-i2v
          enum:
            - happyhorse-1.0-i2v
            - happyhorse-1.1-i2v
        input:
          type: object
          description: Basic input information, such as prompt, etc.
          properties:
            prompt:
              type: string
              description: >-
                Text prompt, used to describe the expected video content to
                generate. Supports any language input, with a maximum length of
                5000 non-Chinese characters or 2500 Chinese characters.
                Exceeding content will be automatically truncated.
            media:
              type: array
              description: >-
                Input media list. Used to specify the image for video
                generation. Must have exactly 1 first-frame image.
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: 'Media type. Fixed value: first_frame.'
                    enum:
                      - first_frame
                    example: first_frame
                  url:
                    type: string
                    description: >-
                      Media URL. First-frame URL. Supports HTTP or HTTPS
                      protocol. Image limits: format: JPEG, JPG, PNG, WEBP;
                      resolution: both width and height not less than 300
                      pixels; aspect ratio: 1:2.5 to 2.5:1; file size: not
                      exceeding 10MB.
                required:
                  - type
                  - url
          required:
            - media
        parameters:
          type: object
          description: >-
            Video processing parameters, such as setting video resolution,
            duration, etc.
          properties:
            resolution:
              type: string
              description: >-
                Specify the resolution level for generated video, used to
                control video clarity (total pixels). The model automatically
                scales to a similar total pixel based on the selected resolution
                level. The output video aspect ratio is approximately consistent
                with the input first-frame.
              default: 1080P
              enum:
                - 720P
                - 1080P
              example: 720P
            duration:
              type: integer
              description: >-
                Specify the 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.

````