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

# HappyHorse 1.0 Video-Edit 動画編集

> - HappyHorse 1.0 動画編集。1つのソース動画とテキスト指示でスタイル変換、ローカル置換などを実行
- スタイル / 主体ガイド用に 0〜5 枚の参照画像を任意で受け付け
- **`duration` 非対応**：出力動画の再生時間 = `min(入力動画の再生時間, 15)`、モデルが決定
- **`aspect_ratio` 非対応**：出力アスペクト比はソース動画と一致
- **特殊な課金ルール**：`(入力動画の再生時間 + 出力動画の再生時間) × 解像度単価`。モデルは15秒を超える入力を15秒に切り詰め
- 非同期処理モード。返却されたタスクIDで[照会してください](/ja/api-manual/task-management/get-task-detail)
- 生成された動画リンクの有効期限は24時間です。お早めに保存してください



## OpenAPI

````yaml ja/api-manual/video-series/happyhorse1.0/happyhorse-1.0-video-edit.json POST /v1/videos/generations
openapi: 3.1.0
info:
  title: HappyHorse 1.0 Video-Edit API
  description: HappyHorse 1.0 動画編集API。ソース動画とテキスト指示によりスタイル変換、ローカル置換などを実行
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 本番環境
security:
  - bearerAuth: []
tags:
  - name: 動画生成
    description: AI動画生成関連API
paths:
  /v1/videos/generations:
    post:
      tags:
        - 動画生成
      summary: HappyHorse 1.0 Video-Edit 動画編集
      description: >-
        - HappyHorse 1.0 動画編集。1つのソース動画とテキスト指示でスタイル変換、ローカル置換などを実行

        - スタイル / 主体ガイド用に 0〜5 枚の参照画像を任意で受け付け

        - **`duration` 非対応**：出力動画の再生時間 = `min(入力動画の再生時間, 15)`、モデルが決定

        - **`aspect_ratio` 非対応**：出力アスペクト比はソース動画と一致

        - **特殊な課金ルール**：`(入力動画の再生時間 + 出力動画の再生時間) × 解像度単価`。モデルは15秒を超える入力を15秒に切り詰め

        -
        非同期処理モード。返却されたタスクIDで[照会してください](/ja/api-manual/task-management/get-task-detail)

        - 生成された動画リンクの有効期限は24時間です。お早めに保存してください
      operationId: createHappyHorse10VideoEdit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
            examples:
              with_reference:
                summary: 参照画像付き動画編集
                value:
                  model: happyhorse-1.0-video-edit
                  prompt: >-
                    Have the character in the video wear the striped sweater
                    from the image
                  video_urls:
                    - https://cdn.example.com/source.mp4
                  image_urls:
                    - https://cdn.example.com/sweater.jpg
                  quality: 720p
                  keep_original_sound: true
              style_transfer:
                summary: スタイル変換（参照画像なし）
                value:
                  model: happyhorse-1.0-video-edit
                  prompt: Replace the video background with snowy mountains
                  video_urls:
                    - https://cdn.example.com/source.mp4
                  quality: 1080p
                  keep_original_sound: false
      responses:
        '200':
          description: 動画生成タスクの作成に成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationResponse'
        '400':
          description: リクエストパラメータエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: missing_video_urls
                  message: happyhorse-1.0-video-edit requires video_urls or video_url
                  type: invalid_request_error
        '401':
          description: 未認証、Tokenが無効または期限切れ
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: クォータ不足、チャージが必要
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: アクセス権限なし
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: >-
                    Token does not have access to model:
                    happyhorse-1.0-video-edit
                  type: invalid_request_error
        '429':
          description: リクエスト頻度が上限を超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: サーバー内部エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    VideoGenerationRequest:
      type: object
      required:
        - model
        - prompt
        - video_urls
      properties:
        model:
          type: string
          description: 動画生成モデル名
          enum:
            - happyhorse-1.0-video-edit
          default: happyhorse-1.0-video-edit
          example: happyhorse-1.0-video-edit
        prompt:
          type: string
          description: |-
            編集指示テキスト、**必須**

            **長さ制限：**
            - 中国語：最大 `2500` 文字
            - 中国語以外：最大 `5000` 文字
            - 超過部分は自動的に切り詰められます

            **プロンプトのヒント：**
            - 創造的な記述ではなく編集指示を使用してください
            - 例：`主人公の服を画像のストライプセーターに変更`、`動画の背景を雪山に変更`
          example: >-
            Have the character in the video wear the striped sweater from the
            image
        video_urls:
          type: array
          description: >-
            編集対象のソース動画URL、**必須**、**1個のみ**（配列の最初の要素を使用）


            **動画要件：**

            - 対応フォーマット：MP4、MOV（H.264エンコード推奨）

            - 再生時間：`3` ~ `60` 秒

            - モデルは `15` 秒を超える入力を自動的に最初の `15` 秒に切り詰め

            - 解像度：長辺 ≤ `2160` px、短辺 ≥ `320` px

            - アスペクト比：`1:2.5` ~ `2.5:1`

            - ファイルサイズ：≤ `100MB`

            - フレームレート：> `8` fps

            - 動画URLは **公開アクセス可能（HTTP または HTTPS）**
            である必要があります。プライベートOSS、イントラネット、認証必須リンクは非対応


            **互換フィールド：** `video_url` / `video` も受け付け（`video_urls` より優先度が低い）
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 1
          example:
            - https://cdn.example.com/source.mp4
        image_urls:
          type: array
          description: |-
            参照画像URL配列、**任意**、**0 ~ 5 枚**

            スタイル / 主体ガイドに使用。

            **画像要件：**
            - 対応フォーマット：JPEG、JPG、PNG、WEBP
            - 解像度：幅・高さ共に ≥ `300` px
            - アスペクト比：`1:2.5` ~ `2.5:1`
            - ファイルサイズ：≤ `10MB`
            - 画像URLは **公開アクセス可能（HTTP または HTTPS）** である必要があります
          items:
            type: string
            format: uri
          maxItems: 5
          example:
            - https://cdn.example.com/sweater.jpg
        keep_original_sound:
          type: boolean
          description: |-
            入力動画の元音声を保持するか、デフォルトは `false`

            **選択可能な値：**
            - `true`：入力動画の元音声を保持
            - `false`：元音声を破棄。モデルが新しい音声を生成
          default: false
          example: false
        quality:
          type: string
          description: |-
            動画解像度ランク、デフォルトは `720p`

            **選択可能な値：**
            - `720p`：標準解像度、デフォルト値
            - `1080p`：HD解像度

            **課金注意：** 解像度ランクは課金に直接影響します
          enum:
            - 720p
            - 1080p
          default: 720p
          example: 720p
        seed:
          type: integer
          description: |-
            ランダムシード、デフォルトはランダム

            **説明：**
            - 範囲：`1` ~ `2147483647`
            - 固定シードはプロンプト調整時のパラメータ変動を抑え、再現性を向上させます
          minimum: 1
          maximum: 2147483647
          example: 42
        callback_url:
          type: string
          description: >-
            タスク完了後の HTTPS コールバックアドレス


            **コールバックタイミング：**

            - タスク完了、失敗、またはキャンセル時にトリガー

            - 課金確認完了後に送信


            **セキュリティ制限：**

            - HTTPS プロトコルのみ対応

            -
            プライベートIPアドレスへのコールバックは禁止（127.0.0.1、10.x.x.x、172.16-31.x.x、192.168.x.x
            など）

            - URL の長さは `2048` 文字以内


            **コールバックメカニズム：**

            - タイムアウト：`10` 秒

            - 失敗後最大 `3` 回リトライ（失敗後 `1`/`2`/`4` 秒でそれぞれリトライ）

            - コールバックレスポンスボディのフォーマットはタスク照会APIの返却フォーマットと同一

            - 2xx ステータスコードを成功とみなし、その他のステータスコードでリトライをトリガー
          format: uri
          example: https://your-domain.com/webhooks/video-task-completed
    VideoGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: タスク作成タイムスタンプ
          example: 1761313744
        id:
          type: string
          description: タスクID
          example: task-unified-1761313744-h1edgh12
        model:
          type: string
          description: 実際に使用されたモデル名
          example: happyhorse-1.0-video-edit
        object:
          type: string
          enum:
            - video.generation.task
          description: タスクの具体的なタイプ
        progress:
          type: integer
          description: タスク進捗パーセンテージ (0-100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: タスクステータス
          enum:
            - pending
            - processing
            - completed
            - failed
            - cancelled
          example: pending
        task_info:
          $ref: '#/components/schemas/VideoTaskInfo'
          description: 動画タスクの詳細情報
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          description: タスクの出力タイプ
          example: video
        usage:
          $ref: '#/components/schemas/VideoUsage'
          description: 使用量と課金情報
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: エラーコード識別子
            message:
              type: string
              description: エラー説明メッセージ
            type:
              type: string
              description: エラータイプ
    VideoTaskInfo:
      type: object
      properties:
        can_cancel:
          type: boolean
          description: タスクがキャンセル可能かどうか
          example: true
        estimated_time:
          type: integer
          description: 推定完了時間（秒）
          minimum: 0
          example: 2400
        video_duration:
          type: integer
          description: 出力動画の再生時間（秒）、min(入力動画の再生時間, 15) と等しい
          example: 6
    VideoUsage:
      type: object
      description: >-
        使用量と課金情報。EDIT課金 = (入力動画の再生時間 + 出力動画の再生時間) × 解像度単価。事前控除はローカルで検出した入力時間 × 2
        で見積もり、実際の控除はモデルが返却する usage フィールドに基づき調整
      properties:
        billing_rule:
          type: string
          description: 課金ルール
          enum:
            - per_call
            - per_token
            - per_second
          example: per_second
        credits_reserved:
          type: number
          description: 推定消費クレジット数（入力時間 × 2 で事前控除）
          minimum: 0
          example: 1608660
        user_group:
          type: string
          description: ユーザーグループカテゴリ
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##すべてのAPIはBearer Tokenによる認証が必要です##

        **APIキーの取得：**

        [APIキー管理ページ](https://evolink.ai/dashboard/keys) にアクセスしてAPIキーを取得してください

        **リクエストヘッダーに以下を追加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````