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

# Wan2.7 動画編集

> - WAN2.7 (wan2.7-video-edit) モデルは**指示ベースの編集**および**動画移行**タスクをサポート
- **必須:** ちょうど 1 つの動画 (`video_urls`) をアップロード。任意で最大 4 枚の参照画像 (`image_urls`)
- 2 つの利用パターン:
  - **指示のみ編集:** `video_urls` + `prompt` を送信（例: スタイル変更、衣装変更）
  - **指示 + 参照画像:** `video_urls` + `image_urls` + `prompt` を送信（例: 参照画像の要素で局所置換）
- 音声処理: `keep_original_sound` で制御（`true` 元音声保持、`false` モデルが音声を自動処理）
- 非同期処理モード、返却されたタスク ID で[ステータスを照会](/ja/api-manual/task-management/get-task-detail)
- 生成された動画リンクの有効期間は 24 時間です。お早めに保存してください
- **課金:** 「入力動画長 + 出力動画長」で課金。生成成功時のみ課金、失敗は無料



## OpenAPI

````yaml ja/api-manual/video-series/wan2.7/wan2.7-video-edit.json POST /v1/videos/generations
openapi: 3.1.0
info:
  title: wan2.7-video-edit API
  description: WAN2.7 モデルで動画を編集。動画アップロードと参照画像を組み合わせた編集をサポート
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 本番環境
security:
  - bearerAuth: []
paths:
  /v1/videos/generations:
    post:
      tags:
        - 動画生成
      summary: wan2.7-video-edit API
      description: >-
        - WAN2.7 (wan2.7-video-edit) モデルは**指示ベースの編集**および**動画移行**タスクをサポート

        - **必須:** ちょうど 1 つの動画 (`video_urls`) をアップロード。任意で最大 4 枚の参照画像
        (`image_urls`)

        - 2 つの利用パターン:
          - **指示のみ編集:** `video_urls` + `prompt` を送信（例: スタイル変更、衣装変更）
          - **指示 + 参照画像:** `video_urls` + `image_urls` + `prompt` を送信（例: 参照画像の要素で局所置換）
        - 音声処理: `keep_original_sound` で制御（`true` 元音声保持、`false` モデルが音声を自動処理）

        - 非同期処理モード、返却されたタスク ID
        で[ステータスを照会](/ja/api-manual/task-management/get-task-detail)

        - 生成された動画リンクの有効期間は 24 時間です。お早めに保存してください

        - **課金:** 「入力動画長 + 出力動画長」で課金。生成成功時のみ課金、失敗は無料
      operationId: createWan27VideoEditGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan27VideoEditRequest'
            examples:
              instruction_edit:
                summary: 指示のみ編集（スタイル変更）
                value:
                  model: wan2.7-video-edit
                  prompt: シーン全体を粘土風に変換
                  video_urls:
                    - https://example.com/source.mp4
              instruction_with_reference:
                summary: 指示 + 参照画像（局所置換）
                value:
                  model: wan2.7-video-edit
                  prompt: 動画内の女の子の服を参照画像の服に置き換え
                  video_urls:
                    - https://example.com/source.mp4
                  image_urls:
                    - https://example.com/clothes.png
      responses:
        '200':
          description: 動画タスクの作成に成功しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationResponse'
        '400':
          description: リクエストパラメータが無効
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未認証、トークンが無効または期限切れ
          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: wan2.7-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:
    Wan27VideoEditRequest:
      required:
        - model
        - video_urls
      type: object
      properties:
        model:
          type: string
          description: モデル名、`wan2.7-video-edit` 固定
          enum:
            - wan2.7-video-edit
          example: wan2.7-video-edit
        prompt:
          type: string
          description: >-
            編集効果を記述するテキストプロンプト。中国語と英語をサポート、各文字/アルファベットを 1
            文字としてカウントし、超過分は自動的に切り詰められます。最大 5000 文字
          maxLength: 5000
          example: キャラに派手な衣装を着せ、参照画像の帽子をかぶせる
        negative_prompt:
          type: string
          description: 動画に表示したくない内容を記述するネガティブプロンプト。中国語と英語をサポート、最大 500 文字、超過分は自動的に切り詰められます
          maxLength: 500
          example: ぼやけ、低品質
        video_urls:
          type: array
          items:
            type: string
            format: uri
          description: |-
            ソース動画 URL のリスト。**ちょうど 1 動画必須**

            **動画制限:**
            - フォーマット: mp4、mov
            - 長さ: `2 ~ 10` 秒
            - 解像度: 幅・高さが `[240, 4096]` ピクセル
            - アスペクト比: 1:8 ~ 8:1
            - ファイルサイズ: `100MB` 以下
          minItems: 1
          maxItems: 1
          example:
            - https://example.com/source.mp4
        image_urls:
          type: array
          items:
            type: string
            format: uri
          description: |-
            参照画像 URL のリスト、最大 4 枚。「指示 + 参照画像」シナリオで利用可能。例: 動画内の衣装や小物を参照画像の要素で置き換える

            **画像制限:**
            - フォーマット: JPEG、JPG、PNG（透明非対応）、BMP、WEBP
            - 解像度: 幅・高さが `[240, 8000]` ピクセル
            - アスペクト比: 1:8 ~ 8:1
            - ファイルサイズ: `20MB` 以下
          maxItems: 4
          example:
            - https://example.com/ref.jpg
        keep_original_sound:
          type: boolean
          description: >-
            編集後動画の音声処理。デフォルト: `false`


            - `false`: スマートモード。モデルが `prompt` 内容に基づき判断 —
            プロンプトに音声要素が含まれる場合は音声を再生成、それ以外は元の入力動画の音声を保持する可能性あり

            - `true`: 入力動画の元音声を強制保持、再生成しない
          default: false
          example: true
        quality:
          type: string
          description: |-
            動画品質、デフォルト `720p`

            **オプション:**
            - `720p`: 標準画質、標準価格（デフォルト）
            - `1080p`: 高画質、価格が高くなります
          enum:
            - 720p
            - 1080p
          default: 720p
          example: 720p
        aspect_ratio:
          type: string
          description: >-
            動画のアスペクト比（オプション）


            **動作:**

            - 未指定: 入力動画のアスペクト比に近い比率で生成

            - 指定: 指定した `aspect_ratio` で動画生成


            **画質別の出力解像度:**


            | 画質 | 16:9 | 9:16 | 1:1 | 4:3 | 3:4 |

            | --- | --- | --- | --- | --- | --- |

            | 720p | 1280×720 | 720×1280 | 960×960 | 1104×832 | 832×1104 |

            | 1080p | 1920×1080 | 1080×1920 | 1440×1440 | 1648×1248 | 1248×1648
            |
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
            - '3:4'
          example: '16:9'
        duration:
          type: number
          description: |-
            動画長（秒）

            **ルール:**
            - デフォルト `0`: 入力動画の長さを維持し**切り詰めなし**（入力動画を切り詰めたい場合のみ本フィールドを設定）
            - 明示指定する場合の範囲は `2 ~ 10`: 入力動画を 0 秒から指定 `duration` まで切り詰めます
          minimum: 0
          maximum: 10
          default: 0
          example: 0
        seed:
          type: integer
          description: |-
            ランダムシード、デフォルトはランダム

            **説明:**
            - 範囲: `1` ~ `2147483647`
            - シードを固定するとプロンプト調整時の変動を抑制し再現性が向上します
          minimum: 1
          maximum: 2147483647
          example: 42
        prompt_extend:
          type: boolean
          description: >-
            プロンプトのインテリジェント書き換えを有効にするかどうか。有効にすると、大規模モデルがプロンプトを最適化し、シンプルまたは記述の不十分なプロンプトの結果を大幅に改善します。


            **注意:** デフォルト値は `false` です。フィールドを省略するか `false`
            を送信した場合、書き換えは行われません。有効にするには明示的に `true` を送信してください。
          default: false
          example: false
        callback_url:
          type: string
          description: >-
            タスク完了時の HTTPS コールバック URL


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

            - タスクの完了 (completed)、失敗 (failed)、キャンセル (cancelled) 時にトリガー

            - 課金確定後に送信


            **セキュリティ制約:**

            - 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: 1757169743
        id:
          type: string
          description: タスク ID
          example: task-unified-1757169743-7cvnl5zw
        model:
          type: string
          description: 実際に使用したモデル名
          example: wan2.7-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
          example: pending
        task_info:
          $ref: '#/components/schemas/VideoTaskInfo'
          description: 動画タスクの詳細情報
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          description: タスクの出力タイプ
          example: video
        usage:
          $ref: '#/components/schemas/Usage'
          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: 120
    Usage:
      type: object
      description: 使用量と課金情報
      properties:
        billing_rule:
          type: string
          description: 課金ルール
          enum:
            - per_call
            - per_token
            - per_second
          example: per_call
        credits_reserved:
          type: number
          description: 推定消費クレジット
          minimum: 0
          example: 5
        user_group:
          type: string
          description: ユーザーグループ
          enum:
            - default
            - vip
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ## すべての API は Bearer Token 認証が必要です ##

        **API Key の取得:**

        [API Key 管理ページ](https://evolink.ai/dashboard/keys) で API Key を取得してください

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

````