Skip to main content
POST
  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 response result through the unified Query Task Status endpoint.
MAGI-2 is Sand AI’s video generation model. It creates 1080p clips up to 30 seconds long with dialogue, sound effects and ambience generated together with the picture. It suits short dramas, ads, product shots and social clips that need long takes, spoken lines and consistent characters.

Models

  • magi-2 - Text-to-video, first/last-frame and multimodal reference-to-video with synchronized audio

Features

  • 1080p video from 4 to 30 seconds in one generation
  • Synchronized dialogue, sound effects and ambience
  • Six aspect ratios: 16:9, 9:16, 1:1, 4:3, 3:4 and 21:9
  • First-frame and first-and-last-frame control
  • Up to 10 reference images, 5 reference videos and 5 reference audio clips in one task
  • Prompts up to 15,000 characters for detailed scripts and shot lists

Input modes

  • Text to video: send prompt with the scene, motion, camera and sound.
  • First and last frames: send one image in image_urls as the opening frame, or two images for the opening and closing frames. The video follows the aspect ratio of the first frame.
  • Reference to video: send any combination of reference_image_urls, reference_video_urls and reference_audio_urls, including reference audio on its own, and describe in prompt how each reference is used.

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 for text-to-video and reference-to-video; auto for first and last frames.
  • image_urls (string[]): One or two images: the opening frame and an optional closing frame. JPG, PNG or WEBP.
  • reference_image_urls (string[]): Up to 10 reference images.
  • reference_video_urls (string[]): Up to 5 MP4 or MOV videos, each 2–30 seconds and up to 30 seconds in total.
  • reference_audio_urls (string[]): Up to 5 MP3 or WAV clips, each 2–30 seconds and up to 30 seconds in total.
  • generate_audio (boolean): true (default) generates synchronized audio; false returns a video-only file.
  • seed (integer): Random seed from 0 to 2147483647.

Resolution

Every video is 1080p-class. The frame size follows the aspect ratio, for example 1920×1080 at 16:9, 1080×1920 at 9:16 and 2182×950 at 21:9.

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

  • Text to video with dialogue: describe the scene and put the spoken line in quotes; the character speaks it in the generated audio.
  • First and last frames: send the opening frame in image_urls, or add a second image to set the closing frame.
  • Reference to video: send a character image and a music clip, then describe the new scene in prompt; the same character appears in the new setting and plays along with the music.

Notes

  • Use image_urls for first and last frames, or the reference_* fields for references; each task uses one of these two modes.
  • All media URLs must be publicly accessible and directly downloadable.

Authorizations

Authorization
string
header
required

All API endpoints require Bearer Token authentication.

Create an API key: sign in to PoYo, open Dashboard → API Key at poyo.ai/dashboard/api-key, and click to create a key.

Add it to the request header:

Body

application/json
model
enum<string>
required

Public model identifier.

Available options:
magi-2
input
object
required
callback_url
string<uri>

Webhook URL for finished or failed task notifications.

Response

Task submitted successfully

code
enum<integer>
required

Business status code. 200 means success; any other value means the request failed. Always check this field: some validation errors return HTTP 200 with code: 400 in the body.

  • 200: Success
  • 400: Invalid request parameters
  • 401: Missing or invalid API key
  • 402: Insufficient credits
  • 403: Permission denied
  • 404: Resource not found
  • 408: Request timeout
  • 429: Rate limit exceeded
  • 500: Internal server error
  • 502: Upstream service error
  • 503: Service unavailable

See Error Codes for details.

Available options:
200,
400,
401,
402,
403,
404,
408,
429,
500,
502,
503
Example:

200

data
object
required