> ## 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 Complete Parameter Guide

> Complete parameter reference for MAGI-2. Use `model` to select a model in this folder. Required fields and input requirements are listed for each mode.

| Model ID | Mode | Required fields (excluding 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 | At least one of `image_urls` / `video_urls` / `audio_urls` |

### Text-to-Video

- Generate 1080p videos from text prompts, with synchronized audio by default
- Supports any integer duration from `4`–`30` seconds

### Image-to-Video

- Input 1 image for first-frame video generation, input 2 images for first-last-frame video generation
- The prompt is optional; the first frame alone can drive the video

### Reference-to-Video

- Input reference images (0–10) + reference videos (0–5) + reference audio (0–5) + text prompt to generate video
- At least one of the three reference types is required; they can be combined freely

- Asynchronous processing mode, use the returned task ID to [query status](/en/api-manual/task-management/get-task-detail)
- Generated video links are valid for 7 days, please save them promptly



## OpenAPI

````yaml en/api-manual/video-series/magi/magi-2/magi-2-overview.json POST /v1/videos/generations
openapi: 3.1.0
info:
  title: MAGI-2 Complete Parameter Guide
  description: >-
    Combined parameter reference for the 3 models in this MAGI-2 folder. Select
    a mode via model; required fields and limits are listed below.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Video Generation
    description: AI video generation endpoints
paths:
  /v1/videos/generations:
    post:
      tags:
        - Video Generation
      summary: MAGI-2 Complete Parameter Guide
      description: >-
        Complete parameter reference for MAGI-2. Use `model` to select a model
        in this folder. Required fields and input requirements are listed for
        each mode.


        | Model ID | Mode | Required fields (excluding 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 | At least one of
        `image_urls` / `video_urls` / `audio_urls` |


        ### Text-to-Video


        - Generate 1080p videos from text prompts, with synchronized audio by
        default

        - Supports any integer duration from `4`–`30` seconds


        ### Image-to-Video


        - Input 1 image for first-frame video generation, input 2 images for
        first-last-frame video generation

        - The prompt is optional; the first frame alone can drive the video


        ### Reference-to-Video


        - Input reference images (0–10) + reference videos (0–5) + reference
        audio (0–5) + text prompt to generate video

        - At least one of the three reference types is required; they can be
        combined freely


        - Asynchronous processing mode, use the returned task ID to [query
        status](/en/api-manual/task-management/get-task-detail)

        - Generated video links are valid for 7 days, please save them promptly
      operationId: createMagi2Video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
            examples:
              text_to_video_basic:
                summary: Basic text-to-video
                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: Portrait + fixed seed
                value:
                  model: magi-2-text-to-video
                  prompt: >-
                    On a rainy neon-lit street at night, a woman in a trench
                    coat walks slowly toward the camera under an umbrella;
                    puddles reflect the flickering signs, and a tram passes in
                    the distance
                  duration: 10
                  aspect_ratio: '9:16'
                  seed: 42
              image_to_video_first_frame:
                summary: First-frame image-to-video
                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: First-last-frame image-to-video
                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: Multimodal reference (image + video + audio)
                value:
                  model: magi-2-reference-to-video
                  prompt: >-
                    Follow the camera movement and rhythm of the reference
                    video, and have the character from the image dance on a city
                    rooftop to the beat of the reference audio
                  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: Multi-image reference
                value:
                  model: magi-2-reference-to-video
                  prompt: >-
                    The two characters from the images sit across from each
                    other in a café, talking quietly
                  image_urls:
                    - https://example.com/ref1.jpg
                    - https://example.com/ref2.jpg
                  duration: 6
                  aspect_ratio: '4:3'
              reference_to_video_audio_reference:
                summary: Audio reference
                value:
                  model: magi-2-reference-to-video
                  prompt: >-
                    A news anchor presents the morning news facing the camera,
                    with lip movements synced to the audio
                  audio_urls:
                    - https://example.com/voice.wav
                  duration: 8
                  aspect_ratio: '16:9'
      responses:
        '200':
          description: Video generation task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: Unauthenticated, token invalid or expired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: Insufficient quota, top-up required
          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: Access denied
          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: Rate limit exceeded
          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: Internal server error
          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: >-
        This page combines the parameters of all modes. Required fields,
        accepted values, and defaults depend on the selected model; differences
        are listed by mode below.
      required:
        - model
      properties:
        model:
          type: string
          description: >-
            Video generation model name


            | Model ID | Mode | Required fields (excluding 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 | At least one of
            `image_urls` / `video_urls` / `audio_urls` |
          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**


            Text prompt describing the desired video. Supports both Chinese and
            English. Maximum prompt length: 15000 characters


            **Note:**

            - This model is text-to-video only and does not support
            `image_urls`, `video_urls`, or `audio_urls` input


            **Image-to-Video**


            Text prompt describing the desired video (optional). Supports both
            Chinese and English. Maximum prompt length: 15000 characters


            **Note:**

            - This model does not support `video_urls` or `audio_urls` input


            **Reference-to-Video**


            Text prompt describing the desired video (optional). Supports both
            Chinese and English. Maximum prompt length: 15000 characters
          example: >-
            Follow the camera movement and rhythm of the reference video, and
            have the character from the image dance on a city rooftop to the
            beat of the reference audio
        image_urls:
          type: array
          items:
            type: string
            format: uri
          maxItems: 10
          example:
            - https://example.com/ref1.jpg
          description: >-
            Applies only to: **Image-to-Video**, **Reference-to-Video**


            **Image-to-Video**


            Image URL array, **1–2 images**


            **Image count and behavior:**


            | Image Count | Behavior | Role |

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

            | 1 image | First-frame image-to-video | Automatically set as
            `first_frame` |

            | 2 images | First-last-frame image-to-video | 1st image →
            `first_frame`, 2nd image → `last_frame` |


            **Image requirements:**

            - Max size per image: `30MB`

            - URL length per image must not exceed `8192` characters

            - Only HTTPS URLs are supported; image URLs must be directly
            accessible by the server


            **Reference-to-Video**


            Reference image URL array, **0–10 images**


            **Role description:**


            | Media Type | Role | Typical Usage |

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

            | Image | `reference_image` | Character reference, style reference,
            product image |


            **Image requirements:**

            - Max size per image: `30MB`

            - Only HTTPS URLs are supported; image URLs must be directly
            accessible by the server


            **Note:** At least one of `image_urls`, `video_urls`, or
            `audio_urls` must be provided
        video_urls:
          type: array
          items:
            type: string
            format: uri
          maxItems: 5
          example:
            - https://example.com/reference.mp4
          description: >-
            Applies only to: **Reference-to-Video**


            Reference video URL array, **0–5 videos**


            **Role description:**


            | Media Type | Role | Typical Usage |

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

            | Video | `reference_video` | Camera movement reference, motion
            reference, visual style reference |


            **Video requirements:**

            - Supported formats: `.mp4`, `.mov`

            - Duration per video: `2` ~ `30` seconds, max 5 videos, total
            duration of all videos ≤ `30` seconds

            - Max size per video: `200MB`

            - Only HTTPS URLs are supported; video URLs must be directly
            accessible by the server


            **Note:** At least one of `image_urls`, `video_urls`, or
            `audio_urls` must be provided
        audio_urls:
          type: array
          items:
            type: string
            format: uri
          maxItems: 5
          example:
            - https://example.com/bgm.mp3
          description: >-
            Applies only to: **Reference-to-Video**


            Reference audio URL array, **0–5 clips**


            **Role description:**


            | Media Type | Role | Typical Usage |

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

            | Audio | `reference_audio` | Background music, sound effects,
            voice/dialogue reference |


            **Audio requirements:**

            - Supported formats: `.wav`, `.mp3`

            - Duration per clip: `2` ~ `30` seconds, max 5 clips, total duration
            of all audio ≤ `30` seconds

            - Max size per clip: `15MB`

            - Only HTTPS URLs are supported; audio URLs must be directly
            accessible by the server


            **Note:** At least one of `image_urls`, `video_urls`, or
            `audio_urls` must be provided
        duration:
          type: integer
          description: |-
            **Text-to-Video / Image-to-Video**

            Video duration (seconds), defaults to `5` seconds

            **Details:**
            - Supports any integer value between `4`–`30` seconds
            - Duration directly affects billing

            **Reference-to-Video**

            Output video duration (seconds), defaults to `5` seconds

            **Details:**
            - Supports any integer value between `4`–`30` seconds
            - Duration directly affects billing
          default: 5
          minimum: 4
          maximum: 30
          example: 8
        quality:
          type: string
          description: Video resolution, only `1080p` is supported
          enum:
            - 1080p
          default: 1080p
          example: 1080p
        aspect_ratio:
          type: string
          description: >-
            **Text-to-Video / Reference-to-Video**


            Video aspect ratio, defaults to `16:9`


            **Options:**

            - `16:9` (landscape), `9:16` (portrait), `1:1` (square), `4:3`,
            `3:4`, `21:9` (ultrawide)


            **Image-to-Video**


            Video aspect ratio, defaults to `16:9`


            **Options:**

            - `16:9` (landscape), `9:16` (portrait), `1:1` (square), `4:3`,
            `3:4`, `21:9` (ultrawide)


            **Details:**

            - The video is generated at the selected aspect ratio; if the
            first-frame image has a different aspect ratio, the first frame is
            center-cropped to fit

            - If the first frame is a portrait image, set an aspect ratio close
            to the image's, such as `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**


            Whether to generate synchronized audio, defaults to `true`


            **Options:**

            - `true`: Video includes synchronized audio (voice, sound effects,
            background music) at no additional charge. It is recommended to
            place dialogue within double quotes to optimize audio generation

            - `false`: Output silent video


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


            Whether to generate synchronized audio, defaults to `true`


            **Options:**

            - `true`: Video includes synchronized audio at no additional charge

            - `false`: Output silent video
          default: true
          example: true
        seed:
          type: integer
          description: >-
            Random seed, range `0`–`4294967295`


            **Details:**

            - A random seed is used when omitted

            - With all other parameters unchanged, reusing the same seed helps
            reproduce similar results
          minimum: 0
          maximum: 4294967295
          example: 42
        callback_url:
          type: string
          description: >-
            HTTPS callback URL for task completion


            **Callback timing:**

            - Triggered when the task is completed, failed, or cancelled

            - Sent after billing confirmation is complete


            **Security restrictions:**

            - Only HTTPS protocol is supported

            - Callbacks to private IP addresses are prohibited (127.0.0.1,
            10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)

            - URL length must not exceed `2048` characters


            **Callback mechanism:**

            - Timeout: `10` seconds

            - Up to `3` retries after failure (at `1`/`2`/`4` seconds after
            failure respectively)

            - Callback response body format is consistent with the task query
            endpoint response format

            - A 2xx status code is considered successful; other status codes
            trigger retries
          format: uri
          example: https://your-domain.com/webhooks/video-task-completed
    VideoGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: Task creation timestamp
          example: 1761313744
        id:
          type: string
          description: Task ID
          example: task-unified-1774857405-abc123
        model:
          type: string
          description: Actual model name used
          example: magi-2-text-to-video
        object:
          type: string
          enum:
            - video.generation.task
          description: Specific type of the task
        progress:
          type: integer
          description: Task progress percentage (0-100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: Task status
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          $ref: '#/components/schemas/VideoTaskInfo'
          description: Video task details
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          description: Output type of the task
          example: video
        usage:
          $ref: '#/components/schemas/VideoUsage'
          description: Usage and billing information
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code identifier
            message:
              type: string
              description: Error description message
            type:
              type: string
              description: Error type
    VideoTaskInfo:
      type: object
      properties:
        can_cancel:
          type: boolean
          description: >-
            Whether the task can be cancelled. MAGI-2 does not support user
            cancellation; this field always returns `false`.
          example: false
        estimated_time:
          type: integer
          description: Estimated completion time (seconds)
          minimum: 0
          example: 165
        video_duration:
          type: integer
          description: Video duration (seconds)
          example: 8
    VideoUsage:
      type: object
      description: Usage and billing information
      properties:
        billing_rule:
          type: string
          description: Billing rule
          enum:
            - per_call
            - per_token
            - per_second
          example: per_second
        credits_reserved:
          type: number
          description: Estimated credits consumed
          minimum: 0
          example: 50
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        ##All endpoints require Bearer Token authentication##


        **Get API Key:**


        Visit the [API Key Management Page](https://evolink.ai/dashboard/keys)
        to obtain your API Key


        **Add to request header:**

        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

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