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

# MAGI-2 Text to Video

> Sand AI MAGI-2 Text to Video generates 4-30 second 1080p, 25 fps videos with synchronized native audio from prompts up to 8000 characters across six aspect ratios.

> [!NOTE]
>
> MAGI-2 renders native 1080p, 25 fps audio-video clips (finished output is \~0.24s longer than `duration`) and typically takes **13–20 minutes** depending on length. Use `callback_url` or patient polling on `GET /v1/videos/status/{task_id}`. Billing is flat per requested second regardless of aspect ratio or `generate_audio`.


## OpenAPI

````yaml api-reference/openapi/magi-2--magi-2-t2v.yaml POST /v1/videos/generations
openapi: 3.1.0
info:
  title: MAGI-2 Text to Video API
  version: 1.0.0
  description: >-
    Sand AI MAGI-2 Text to Video generates 4-30 second 1080p, 25 fps clips with
    synchronized native audio from prompts up to 8000 characters across six
    aspect ratios. In APIPod, the public model ID is magi-2-t2v. It supports
    text-to-video, accepts text inputs, and returns results through asynchronous
    video tasks.
servers:
  - url: https://api.apipod.ai
    description: Production
security: []
paths:
  /v1/videos/generations:
    post:
      tags:
        - MAGI-2 Text to Video
      summary: Create Generation Task
      description: >-
        Sand AI MAGI-2 Text to Video generates 4-30 second 1080p, 25 fps clips
        with synchronized native audio from prompts up to 8000 characters across
        six aspect ratios. In APIPod, the public model ID is magi-2-t2v.
      operationId: create-magi-2-magi-2-t2v
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              title: MAGI-2 Text to Video
              properties:
                model:
                  type: string
                  title: Model ID
                  description: Public APIPod model ID.
                  const: magi-2-t2v
                prompt:
                  type: string
                  title: Prompt
                  description: >-
                    Describe the video to generate. Required, up to 8000
                    characters.
                  minLength: 1
                  maxLength: 8000
                duration:
                  type: integer
                  title: Duration
                  description: Output video duration in seconds (4-30, default 5).
                  minimum: 4
                  maximum: 30
                  default: 5
                resolution:
                  type: string
                  title: Resolution
                  description: Output resolution. MAGI-2 supports native 1080p at 25 fps.
                  enum:
                    - 1080p
                  default: 1080p
                aspect_ratio:
                  type: string
                  title: Aspect Ratio
                  description: Aspect ratio of the generated video.
                  enum:
                    - '21:9'
                    - '16:9'
                    - '4:3'
                    - '1:1'
                    - '3:4'
                    - '9:16'
                  default: '16:9'
                generate_audio:
                  type: boolean
                  title: Generate Audio
                  description: Generate synchronized native audio alongside the video.
                  default: true
                callback_url:
                  type: string
                  title: Callback URL
                  description: >-
                    Optional webhook URL to receive task completion
                    notifications.
              required:
                - model
                - prompt
            example:
              model: magi-2-t2v
              prompt: >-
                A paper boat drifting down a rainy city street at dusk, slow
                tracking shot, puddle reflections, gentle rain ambience
              duration: 5
              resolution: 1080p
              aspect_ratio: '16:9'
              generate_audio: true
      responses:
        '200':
          description: Task accepted
          content:
            application/json:
              schema:
                type: object
                title: Task Submit Response
                description: Standard response for task submission
                properties:
                  code:
                    type: integer
                  data:
                    type: object
                    title: Task Submit Data
                    properties:
                      task_id:
                        type: string
                        description: generation task id
                  message:
                    type: string
                required:
                  - code
                  - message
                  - data
              example:
                code: 200
                message: success
                data:
                  task_id: vid_task_01JEXAMPLE
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl https://api.apipod.ai/v1/videos/generations \
              -H "Authorization: Bearer $APIPOD_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
              "model": "magi-2-t2v",
              "prompt": "A paper boat drifting down a rainy city street at dusk, slow tracking shot",
              "duration": 5,
              "resolution": "1080p",
              "aspect_ratio": "16:9",
              "generate_audio": true
            }'
        - lang: Python
          label: Python
          source: |-
            import os import requests
            response = requests.post(
                "https://api.apipod.ai/v1/videos/generations",
                headers={
                    "Authorization": f"Bearer {os.environ['APIPOD_API_KEY']}",
                    "Content-Type": "application/json",
                },
                json={
                    "model": "magi-2-t2v",
                    "prompt": "A paper boat drifting down a rainy city street at dusk, slow tracking shot",
                    "duration": 5,
                    "resolution": "1080p",
                    "aspect_ratio": "16:9",
                    "generate_audio": True,
                },
                timeout=60,
            ) response.raise_for_status() print(response.json())
        - lang: JavaScript
          label: Node.js
          source: >-
            const response = await
            fetch("https://api.apipod.ai/v1/videos/generations", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.APIPOD_API_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                model: "magi-2-t2v",
                prompt: "A paper boat drifting down a rainy city street at dusk, slow tracking shot",
                duration: 5,
                resolution: "1080p",
                aspect_ratio: "16:9",
                generate_audio: true,
              }),
            });

            if (!response.ok) {
              throw new Error(`APIPod request failed: ${response.status} ${await response.text()}`);
            }

            console.log(await response.json());
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: APIPod API key
      description: Use your APIPod API key as a Bearer token in the Authorization header.

````

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