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

# Video Editing

> Video Editing - Edit video based on videos and reference images

This is the **HappyHorse Video API** video editing interface, editing videos based on videos and reference images.


## OpenAPI

````yaml openapi/en/happyhorse-video-edit.json POST /happyhorse/api/v1/services/aigc/video-generation/video-synthesis
openapi: 3.1.0
info:
  title: HappyHorse Video Edit API
  version: 1.0.0
  description: HappyHorse Video Edit API - Edit video based on videos and reference images
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /happyhorse/api/v1/services/aigc/video-generation/video-synthesis:
    post:
      description: Video Editing - Edit video based on videos and reference images
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoEditRequest'
      responses:
        '200':
          $ref: '#/components/responses/HappyHorseSuccessResponse'
          description: Success Response
      security:
        - CustomApiKey: []
components:
  schemas:
    VideoEditRequest:
      type: object
      properties:
        model:
          type: string
          description: 'Model name. Fixed value: happyhorse-1.0-video-edit.'
          default: happyhorse-1.0-video-edit
          example: happyhorse-1.0-video-edit
        input:
          type: object
          description: >-
            Basic input information, including video to edit, reference images
            and prompt.
          properties:
            prompt:
              type: string
              description: >-
                Text prompt, used to describe the editing intent for the video,
                such as style transfer, partial replacement, etc. 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: >-
                Media list, used to specify the video to edit and reference
                images. Array must contain 1 video type element; optionally
                contain 0 to 5 reference_image type elements.
              items:
                oneOf:
                  - type: object
                    description: Video to edit
                    properties:
                      type:
                        type: string
                        description: 'Media type. Fixed value: video (video to edit).'
                        enum:
                          - video
                        example: video
                      url:
                        type: string
                        description: >-
                          URL of video to edit, must be a publicly accessible
                          URL. Supports HTTP and HTTPS protocol. Video limits:
                          format: MP4, MOV (H.264 encoding recommended);
                          duration: 3 to 60 seconds; resolution: long side not
                          exceeding 2160 pixels, short side not less than 320
                          pixels; aspect ratio: 1:2.5 to 2.5:1; file size: not
                          exceeding 100MB; frame rate: greater than 8fps. Output
                          video duration: 3 to 15 seconds (when input video is
                          not more than 15 seconds, output duration is
                          consistent with input; when input video exceeds 15
                          seconds, system will automatically truncate the first
                          15 seconds as valid segment, so maximum output is 15
                          seconds).
                    required:
                      - type
                      - url
                  - type: object
                    description: Reference image
                    properties:
                      type:
                        type: string
                        description: 'Media type. Fixed value: reference_image.'
                        enum:
                          - reference_image
                        example: reference_image
                      url:
                        type: string
                        description: >-
                          URL of reference image, must be a publicly accessible
                          URL. Supports HTTP or HTTPS protocol. Image limits:
                          format: JPEG, JPG, PNG, WEBP; resolution: 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:
            - prompt
            - media
        parameters:
          type: object
          description: Video editing parameters, such as setting video resolution, etc.
          properties:
            resolution:
              type: string
              description: Resolution level of generated video.
              default: 1080P
              enum:
                - 720P
                - 1080P
              example: 720P
            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
            audio_setting:
              type: string
              description: >-
                Audio control. auto: default, controlled by model; origin:
                preserve the original audio of input video.
              default: auto
              enum:
                - auto
                - origin
              example: auto
            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.

````