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

# MAGI-2 Text to Video

> The MAGI-2 Text to Video API generates a 4–30 second 1080p video with synchronized dialogue, sound effects and ambience from a text prompt.

> [!TIP]
>
> 1. After submission, a `task_id` will be returned. If you provided a `callback_url`, when the task status becomes `finished` or `failed`, a POST request will be sent to the `callback_url`.
> 2. Regardless of whether `callback_url` is provided, you can retrieve the result through the unified [Query Task Status](https://docs.vidgo.ai/api-manual/task-management/status.md) endpoint.

MAGI-2 Text to Video is Sand AI's text-to-video generation model. It generates 1080p clips from 4 to 30 seconds long with dialogue, sound effects and ambience created together with the picture. It suits short dramas, ads, product shots and social clips that need long takes and spoken lines.

For first-and-last-frame animation use [MAGI-2 Image to Video](https://docs.vidgo.ai/api-manual/video-series/sand-ai-magi-2-image-to-video.md); for multimodal references use [MAGI-2 Reference to Video](https://docs.vidgo.ai/api-manual/video-series/sand-ai-magi-2-reference-to-video.md).

## Models

* **sand-ai/magi-2/text-to-video** — Text-to-video generation at 1080p for 4–30 seconds with synchronized audio.

## Features

* 1080p video from 4 to 30 seconds in one generation.
* Synchronized dialogue, sound effects and ambience, with an option to generate video only.
* Six aspect ratios: `16:9`, `9:16`, `1:1`, `4:3`, `3:4` and `21:9`.
* Prompts up to 15,000 characters for detailed scripts and shot lists.
* Optional `seed` for reproducible results.

## Required parameters

* `prompt` (string): Scene, subjects, motion, camera and sound, up to 15,000 characters. Put spoken lines in quotes.

## Optional parameters

* `duration` (integer): Length in whole seconds from `4` to `30`. Default `5`.
* `resolution` (string): `1080p`.
* `aspect_ratio` (string): `16:9` (default), `9:16`, `1:1`, `4:3`, `3:4` or `21:9`.
* `generate_audio` (boolean): `true` (default) generates synchronized audio; `false` returns a video-only file.
* `seed` (integer): Random seed from `0` to `2147483647`.

## Output

A finished task returns one MP4 file: H.264 video at 25 fps with an AAC stereo audio track when `generate_audio` is `true`.

## Examples

* **Dialogue scene**: a 5-second `16:9` night street scene with a spoken line in quotes.
* **Vertical clip**: a 4-second `9:16` action shot with ambient sound.
* **Ultra-wide silent shot**: a 4-second `21:9` desert shot with `generate_audio: false` and a fixed `seed`.

## Notes

* Fields from other modes (`image_urls`, `reference_*`) are rejected with 400. `model` and `callback_url` belong at the request root, not inside `input`.
* Credits are billed per second of `duration` at 1080p; `generate_audio` does not change the price. Failed tasks are refunded in full. See the [pricing page](https://vidgo.ai/apis/api-pricing) for current rates.


## OpenAPI

````yaml api-manual/video-series/sand-ai-magi-2-text-to-video.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - MAGI-2 Text to Video
  description: >-
    The MAGI-2 Text to Video API generates a 4–30 second 1080p video with
    synchronized dialogue, sound effects and ambience from a text prompt.
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - MAGI-2 Text to Video
      summary: Submit MAGI-2 Text to Video Task
      operationId: submitSandAiMagi2TextToVideoTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              dialogue:
                summary: Text to video with dialogue
                value:
                  model: sand-ai/magi-2/text-to-video
                  callback_url: https://your-domain.com/callback
                  input:
                    prompt: >-
                      In a rainy neon-lit alley at night, a street musician
                      plays a slow saxophone melody and says: "Thanks for
                      staying till the last song."
                    duration: 5
                    aspect_ratio: '16:9'
              ultrawide:
                summary: Ultra-wide silent shot
                value:
                  model: sand-ai/magi-2/text-to-video
                  input:
                    prompt: >-
                      Cinematic ultra-wide shot of a lone rider crossing desert
                      dunes at golden hour.
                    duration: 4
                    aspect_ratio: '21:9'
                    generate_audio: false
                    seed: 20261129
      responses:
        '200':
          description: >-
            Task submission result. A task ID identifies asynchronous work;
            generation may still be running.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          example: sand-ai/magi-2/text-to-video
        callback_url:
          type: string
          format: uri
          description: Optional webhook URL for completion or failure notifications.
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - prompt
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 15000
              description: >-
                Scene, subjects, motion, camera and sound. Put spoken lines in
                quotes.
            duration:
              type: integer
              minimum: 4
              maximum: 30
              default: 5
              description: Video length in whole seconds from 4 to 30. Default 5.
            resolution:
              type: string
              enum:
                - 1080p
              default: 1080p
              description: Output resolution tier (1080p).
            aspect_ratio:
              type: string
              enum:
                - '16:9'
                - '9:16'
                - '1:1'
                - '4:3'
                - '3:4'
                - '21:9'
              default: '16:9'
              description: Output aspect ratio. Default 16:9.
            generate_audio:
              type: boolean
              default: true
              description: >-
                Generate synchronized audio (default true); false returns video
                only.
            seed:
              type: integer
              minimum: 0
              maximum: 2147483647
              description: Optional random seed from 0 to 2147483647.
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-example-001
            status:
              type: string
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-11-29T10:30:00'
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Error message. See [Error Codes](/api-manual/error-codes).
          example: prompt is required
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use `Authorization: Bearer VIDGO_API_KEY`.'

````

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