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

# MAGI-2 全パラメータガイド

> MAGI-2 の統合パラメータリファレンスです。`model` でこのフォルダーのモデルを選択します。必須項目と入力条件をモードごとに記載しています。

| モデル ID | モード | 必須項目（model を除く） |
|---|---|---|
| `magi-2-text-to-video` | Text-to-Video | `prompt` |
| `magi-2-image-to-video` | Image-to-Video | `image_urls` |
| `magi-2-reference-to-video` | Reference-to-Video | `image_urls` / `video_urls` / `audio_urls` のいずれか1つ以上 |

### Text-to-Video

- テキストプロンプトから 1080p 動画を生成（デフォルトで同期音声付き）
- `4`〜`30` 秒の任意の整数で長さを指定可能

### Image-to-Video

- 画像1枚入力で先頭フレーム動画を生成、画像2枚入力で先頭・末尾フレーム動画を生成
- プロンプトは任意。先頭フレームのみでも動画を生成可能

### Reference-to-Video

- 参照画像（0〜10枚）+ 参照動画（0〜5本）+ 参照音声（0〜5本）+ テキストプロンプトで動画を生成
- 3種類の参照素材のうち少なくとも1つが必要で、自由に組み合わせ可能

- 非同期処理モード。返却されたタスクIDで[照会してください](/ja/api-manual/task-management/get-task-detail)
- 生成された動画リンクの有効期限は7日間です。お早めに保存してください



## OpenAPI

````yaml ja/api-manual/video-series/magi/magi-2/magi-2-overview.json POST /v1/videos/generations
openapi: 3.1.0
info:
  title: MAGI-2 全パラメータガイド
  description: この MAGI-2 フォルダーにある 3 モデルの統合パラメータリファレンスです。model でモードを選択し、必須項目と制限は以下に記載しています。
  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: MAGI-2 全パラメータガイド
      description: >-
        MAGI-2 の統合パラメータリファレンスです。`model`
        でこのフォルダーのモデルを選択します。必須項目と入力条件をモードごとに記載しています。


        | モデル ID | モード | 必須項目（model を除く） |

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

        | `magi-2-text-to-video` | Text-to-Video | `prompt` |

        | `magi-2-image-to-video` | Image-to-Video | `image_urls` |

        | `magi-2-reference-to-video` | Reference-to-Video | `image_urls` /
        `video_urls` / `audio_urls` のいずれか1つ以上 |


        ### Text-to-Video


        - テキストプロンプトから 1080p 動画を生成（デフォルトで同期音声付き）

        - `4`〜`30` 秒の任意の整数で長さを指定可能


        ### Image-to-Video


        - 画像1枚入力で先頭フレーム動画を生成、画像2枚入力で先頭・末尾フレーム動画を生成

        - プロンプトは任意。先頭フレームのみでも動画を生成可能


        ### Reference-to-Video


        - 参照画像（0〜10枚）+ 参照動画（0〜5本）+ 参照音声（0〜5本）+ テキストプロンプトで動画を生成

        - 3種類の参照素材のうち少なくとも1つが必要で、自由に組み合わせ可能


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

        - 生成された動画リンクの有効期限は7日間です。お早めに保存してください
      operationId: createMagi2Video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
            examples:
              text_to_video_basic:
                summary: 基本テキストから動画
                value:
                  model: magi-2-text-to-video
                  prompt: >-
                    A macro lens focuses on a green glass frog on a leaf. The
                    focus gradually shifts from its smooth skin to its
                    completely transparent abdomen, where a bright red heart is
                    beating powerfully and rhythmically.
                  duration: 8
                  quality: 1080p
                  aspect_ratio: '16:9'
                  generate_audio: true
              text_to_video_vertical_seed:
                summary: 縦型 + シード固定
                value:
                  model: magi-2-text-to-video
                  prompt: >-
                    雨の夜のネオン街。トレンチコートの女性が傘を差してゆっくりとカメラに近づき、水たまりに点滅する看板が映り、遠くで路面電車が通り過ぎる
                  duration: 10
                  aspect_ratio: '9:16'
                  seed: 42
              image_to_video_first_frame:
                summary: 先頭フレーム画像から動画
                value:
                  model: magi-2-image-to-video
                  prompt: >-
                    The camera slowly zooms in, the scene gradually comes to
                    life
                  image_urls:
                    - https://example.com/first-frame.jpg
                  duration: 5
                  aspect_ratio: '16:9'
              image_to_video_first_last_frame:
                summary: 先頭・末尾フレーム画像から動画
                value:
                  model: magi-2-image-to-video
                  prompt: A smooth transition between two scenes
                  image_urls:
                    - https://example.com/first.jpg
                    - https://example.com/last.jpg
                  duration: 6
                  aspect_ratio: '9:16'
              reference_to_video_multimodal:
                summary: マルチモーダル参照（画像 + 動画 + 音声）
                value:
                  model: magi-2-reference-to-video
                  prompt: 参照動画のカメラワークとリズムに合わせて、画像のキャラクターが街のビルの屋上で踊る。参照音声のビートに同期させる
                  image_urls:
                    - https://example.com/character.jpg
                  video_urls:
                    - https://example.com/reference.mp4
                  audio_urls:
                    - https://example.com/bgm.mp3
                  duration: 10
                  quality: 1080p
                  aspect_ratio: '16:9'
                  generate_audio: true
              reference_to_video_image_reference:
                summary: 複数画像の参照
                value:
                  model: magi-2-reference-to-video
                  prompt: 画像の2人のキャラクターがカフェで向かい合って座り、静かに話している
                  image_urls:
                    - https://example.com/ref1.jpg
                    - https://example.com/ref2.jpg
                  duration: 6
                  aspect_ratio: '4:3'
              reference_to_video_audio_reference:
                summary: 音声の参照
                value:
                  model: magi-2-reference-to-video
                  prompt: ニュースキャスターがカメラに向かって朝のニュースを伝え、口の動きが音声と同期している
                  audio_urls:
                    - https://example.com/voice.wav
                  duration: 8
                  aspect_ratio: '16:9'
      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: 未認証、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: magi-2-text-to-video'
                  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
      description: >-
        このページは各モードのパラメータをまとめています。必須項目、指定可能な値、デフォルト値は選択した model
        に従います。違いは以下のモード別説明を参照してください。
      required:
        - model
      properties:
        model:
          type: string
          description: >-
            動画生成モデル名


            | モデル ID | モード | 必須項目（model を除く） |

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

            | `magi-2-text-to-video` | Text-to-Video | `prompt` |

            | `magi-2-image-to-video` | Image-to-Video | `image_urls` |

            | `magi-2-reference-to-video` | Reference-to-Video | `image_urls` /
            `video_urls` / `audio_urls` のいずれか1つ以上 |
          enum:
            - magi-2-text-to-video
            - magi-2-image-to-video
            - magi-2-reference-to-video
          example: magi-2-text-to-video
        prompt:
          type: string
          description: >-
            **Text-to-Video**


            生成したい動画を説明するテキストプロンプト。中国語・英語に対応。プロンプトの最大長：15000 文字


            **注意：**

            - このモデルはテキストのみの動画生成です。`image_urls`、`video_urls`、`audio_urls`
            の入力には対応していません


            **Image-to-Video**


            生成したい動画を説明するテキストプロンプト（任意）。中国語・英語に対応。プロンプトの最大長：15000 文字


            **注意：**

            - このモデルは `video_urls`、`audio_urls` の入力には対応していません


            **Reference-to-Video**


            生成したい動画を説明するテキストプロンプト（任意）。中国語・英語に対応。プロンプトの最大長：15000 文字
          example: 参照動画のカメラワークとリズムに合わせて、画像のキャラクターが街のビルの屋上で踊る。参照音声のビートに同期させる
        image_urls:
          type: array
          items:
            type: string
            format: uri
          maxItems: 10
          example:
            - https://example.com/ref1.jpg
          description: >-
            対象モード： **Image-to-Video**, **Reference-to-Video**


            **Image-to-Video**


            画像 URL 配列、**1〜2 枚**


            **画像枚数と動作：**


            | 画像枚数 | 動作 | 役割 |

            |:--------:|------|------|

            | 1 枚 | 先頭フレーム画像から動画 | 自動的に `first_frame` に設定 |

            | 2 枚 | 先頭・末尾フレーム画像から動画 | 1枚目 → `first_frame`、2枚目 → `last_frame` |


            **画像要件：**

            - 1枚あたりのサイズ：`30MB` 以内

            - 1枚あたりの URL の長さ：`8192` 文字以内

            - HTTPS URL のみ対応。画像URLはサーバーから直接アクセス可能である必要があります


            **Reference-to-Video**


            参照画像 URL 配列、**0〜10 枚**


            **役割の説明：**


            | メディアタイプ | 役割 | 典型的な用途 |

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

            | 画像 | `reference_image` | キャラクター参照、スタイル参照、商品画像 |


            **画像要件：**

            - 1枚あたりのサイズ：`30MB` 以内

            - HTTPS URL のみ対応。画像URLはサーバーから直接アクセス可能である必要があります


            **注意：** `image_urls`、`video_urls`、`audio_urls`
            のうち少なくとも1つを指定する必要があります
        video_urls:
          type: array
          items:
            type: string
            format: uri
          maxItems: 5
          example:
            - https://example.com/reference.mp4
          description: >-
            対象モード： **Reference-to-Video**


            参照動画 URL 配列、**0〜5 本**


            **役割の説明：**


            | メディアタイプ | 役割 | 典型的な用途 |

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

            | 動画 | `reference_video` | カメラワーク参照、動作参照、映像スタイル参照 |


            **動画要件：**

            - 対応フォーマット：`.mp4`、`.mov`

            - 1本あたりの動画時間：`2` 〜 `30` 秒、最大5本、全動画の合計時間 ≤ `30` 秒

            - 1本あたりのサイズ：`200MB` 以内

            - HTTPS URL のみ対応。動画URLはサーバーから直接アクセス可能である必要があります


            **注意：** `image_urls`、`video_urls`、`audio_urls`
            のうち少なくとも1つを指定する必要があります
        audio_urls:
          type: array
          items:
            type: string
            format: uri
          maxItems: 5
          example:
            - https://example.com/bgm.mp3
          description: >-
            対象モード： **Reference-to-Video**


            参照音声 URL 配列、**0〜5 本**


            **役割の説明：**


            | メディアタイプ | 役割 | 典型的な用途 |

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

            | 音声 | `reference_audio` | BGM、効果音、音声/セリフ参照 |


            **音声要件：**

            - 対応フォーマット：`.wav`、`.mp3`

            - 1本あたりの音声時間：`2` 〜 `30` 秒、最大5本、全音声の合計時間 ≤ `30` 秒

            - 1本あたりのサイズ：`15MB` 以内

            - HTTPS URL のみ対応。音声URLはサーバーから直接アクセス可能である必要があります


            **注意：** `image_urls`、`video_urls`、`audio_urls`
            のうち少なくとも1つを指定する必要があります
        duration:
          type: integer
          description: |-
            **Text-to-Video / Image-to-Video**

            動画の再生時間（秒）、デフォルトは `5` 秒

            **説明：**
            - `4`〜`30` 秒の任意の整数値に対応
            - 再生時間は課金に直接影響します

            **Reference-to-Video**

            出力動画の再生時間（秒）、デフォルトは `5` 秒

            **説明：**
            - `4`〜`30` 秒の任意の整数値に対応
            - 再生時間は課金に直接影響します
          default: 5
          minimum: 4
          maximum: 30
          example: 8
        quality:
          type: string
          description: 動画の解像度。`1080p` のみ対応
          enum:
            - 1080p
          default: 1080p
          example: 1080p
        aspect_ratio:
          type: string
          description: |-
            **Text-to-Video / Reference-to-Video**

            動画のアスペクト比、デフォルトは `16:9`

            **選択可能な値：**
            - `16:9`（横向き）、`9:16`（縦向き）、`1:1`（正方形）、`4:3`、`3:4`、`21:9`（ウルトラワイド）

            **Image-to-Video**

            動画のアスペクト比、デフォルトは `16:9`

            **選択可能な値：**
            - `16:9`（横向き）、`9:16`（縦向き）、`1:1`（正方形）、`4:3`、`3:4`、`21:9`（ウルトラワイド）

            **説明：**
            - 動画は指定したアスペクト比で生成されます。先頭フレーム画像のアスペクト比が異なる場合は、先頭フレームが中央でトリミングされます
            - 先頭フレームが縦長の画像の場合は、`9:16` など画像に近いアスペクト比を指定してください
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
            - '3:4'
            - '21:9'
          default: '16:9'
          example: '16:9'
        generate_audio:
          type: boolean
          description: >-
            **Text-to-Video**


            同期音声を生成するかどうか、デフォルトは `true`


            **選択可能な値：**

            -
            `true`：動画に同期音声（人声、効果音、BGM）を含む、追加料金なし。会話部分をダブルクォーテーションで囲むと音声生成の品質が向上します

            - `false`：無音動画を出力


            **Image-to-Video / Reference-to-Video**


            同期音声を生成するかどうか、デフォルトは `true`


            **選択可能な値：**

            - `true`：動画に同期音声を含む、追加料金なし

            - `false`：無音動画を出力
          default: true
          example: true
        seed:
          type: integer
          description: |-
            ランダムシード。範囲は `0`〜`4294967295`

            **説明：**
            - 指定しない場合は毎回ランダムに生成されます
            - 他のパラメータが同じ場合、同じシードを使うと近い結果を再現しやすくなります
          minimum: 0
          maximum: 4294967295
          example: 42
        callback_url:
          type: string
          description: >-
            タスク完了後の HTTPS コールバックアドレス


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

            - タスク完了（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: 1761313744
        id:
          type: string
          description: タスクID
          example: task-unified-1774857405-abc123
        model:
          type: string
          description: 実際に使用されたモデル名
          example: magi-2-text-to-video
        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/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: >-
            タスクをキャンセルできるかどうか。MAGI-2 はユーザーによるタスクのキャンセルに対応していないため、常に `false`
            を返します。
          example: false
        estimated_time:
          type: integer
          description: 推定完了時間（秒）
          minimum: 0
          example: 165
        video_duration:
          type: integer
          description: 動画の再生時間（秒）
          example: 8
    VideoUsage:
      type: object
      description: 使用量と課金情報
      properties:
        billing_rule:
          type: string
          description: 課金ルール
          enum:
            - per_call
            - per_token
            - per_second
          example: per_second
        credits_reserved:
          type: number
          description: 推定消費クレジット数
          minimum: 0
          example: 50
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##すべてのAPIはBearer Tokenによる認証が必要です##

        **APIキーの取得：**

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

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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.