Sand AI
MAGI 2
magi-2/text-to-video
Sand.ai's multimodal video generation series: text, image, video and audio references can all drive output, with visuals and synchronized sound generated in one pass, selectable durations from 4 to 30 seconds, and support for first/last frame continuity and multiple aspect ratio canvases
Try magi-2/text-to-video
Input
Showcases
View all showcasesOutput
videoPricing
magi-2/text-to-video $0.1258 per second
Overview
A purely text-driven video generation model: input a scene description and get a video clip with visual motion. Duration can be set in whole seconds from 4 to 30, and aspect ratios cover six options: 21:9, 16:9, 4:3, 1:1, 3:4, and 9:16, with 16:9 as the default. By default it also generates dialogue, sound effects, and ambient sound and packages them into the video file, making it suitable for short video creation, advertising previews, and concept demos.
Key Features
- Text alone produces a video — no first-frame image or reference material is needed; just write a prompt to generate a video.
- Large prompt capacity — a single prompt can be up to 15,000 characters, enough to specify the scene, subject actions, camera movement, and sound requirements.
- Flexible duration and aspect ratio — each request can specify an integer duration from 4 to 30 seconds and choose one of six aspect ratios.
- Picture and sound generated in one pass — synchronized dialogue, sound effects, and ambient sound are included by default; you can also disable them to output silent video at the same price.
Capabilities
- Text-to-video: input a prompt describing a scene and actions, and the model outputs a video clip matching the content, suitable for building visuals from scratch.
- Duration control: set from 4 to 30 seconds in whole seconds, default 5 seconds; cost is calculated based on the number of seconds set.
- Aspect ratio selection: choose one of six options — 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 — with 16:9 as the default, fitting landscape, square, and vertical placements.
- Synchronized audio: by default generates dialogue, sound effects, and ambient sound synchronized with the visuals; disabling it outputs silent video without affecting the price.
- Fixed 1080p output: resolution is fixed at 1080p, with no separate selection needed.
Use Cases
- Rapid production of vertical social content — short video creators choose 9:16 and use a scene description to generate a clip suitable for feed playback, for testing topics or filling daily content.
- Advertising concept previews — creatives use structured prompts to describe product entrances and camera movement, output 16:9 sample footage for internal review, and confirm direction before formal shooting.
- Supplementary landscape B-roll for narrative — content teams describe environments and actions to generate 21:9 or 16:9 clips as transitions or atmospheric material in long-form videos.
Limitations and Selection Advice
Prompts are limited to 15,000 characters; duration only supports whole seconds from 4 to 30 and cannot be shorter or longer; aspect ratio can only be one of six enumerated options, and arbitrary ratios are not supported; resolution is fixed at 1080p. Disabling audio generation outputs silent video at the same price. The model does not guarantee frame-by-frame consistency with the prompt, and complex staging or precise actions may require multiple attempts; when you need to start from an existing image, use image-to-video instead, and when you need to reuse character or voice material, use reference-to-video instead.
What's new
View changelog →- New model magi-2/text-to-video is live
- New model magi-2/image-to-video is live
- New model magi-2/reference-to-video is live
Frequently asked questions
View all FAQs →-
How do I choose between image-to-video, reference-to-video, and text-to-video?
If you already have a definite starting frame, use image-to-video; the first frame determines the composition and canvas. To keep characters or scenes consistent across multiple shots, use reference-to-video, which supports up to 10 reference images and up to 5 reference videos and 5 reference audio clips each. If you have no material at all and just want to generate from scratch based on a description, use text-to-video. Only text-to-video and reference-to-video let you directly specify the aspect ratio; image-to-video's canvas follows the first frame.
-
How long a video can this model generate?
duration can be set from 4 to 30 seconds; the default is 5 seconds. Billing is per second, so longer durations cost more. To get a clip of the length you need, just set duration to the corresponding integer.
-
Can the generated audio be turned off? Does turning it off save money?
Yes. generate_audio defaults to true and generates synchronized dialogue, sound effects, and ambient sound; set it to false to get a silent video. Turning off audio does not change the cost — it only removes the audio track — so feel free to turn it off when you need silent footage; there is no need to turn it off to save credits.
-
If I want audio-visual synchronization, how should I write the prompt?
This model's advantage is that it produces picture and sound together in a single generation, so the prompt needs to include the audio. We recommend writing in the order of "main subject and action, camera movement, ambient sound, dialogue or sound effects, pacing," including the original dialogue text along with the speaker, and specifying which action the sound effect occurs on. If you describe only the visuals without writing the audio, the model has no information to align with, and the matching between lip movements and sound effects will degrade.
Create a generation task
https://api.hiapi.ai/v1/tasks Headers
AuthorizationstringRequiredAccount API key. Required on every request. Example: Bearer YOUR_HIAPI_API_KEY. Get your API key
Content-TypestringOptionalThe request body is always parsed as JSON; when sent, only application/json (optionally with charset) is accepted — any other value returns 415. Example: application/json.
Idempotency-KeystringOptionalIdempotency key, up to 255 bytes. Retries with the same key from the same account create the task only once; replays return the original taskId.
On network timeouts or client retries, the same key creates the task only once — no double charges (scope: the API key's account). Use a business-unique identifier as the key (e.g. "order-42"); replays return the original taskId, and keys expire 24 hours after the first request. See the Unified Async API overview for the full scenario matrix.
Body
modelstringRequiredCurrent fixed value: magi-2/text-to-video
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for magi-2/text-to-video and route default — see the parameter table below.
promptstringRequiredminLength 1maxLength 15000Prompt describing the scene, actions, camera movement, and audio, string, maximum 15,000 characters.
durationintegerOptionalDefault: 5min 4max 30Duration of the generated clip in seconds, an integer from 4 to 30, default 5; cost increases with clip duration.
aspect_ratiostringOptionalDefault: "16:9"Aspect ratio of the output image, options are 16:9, 4:3, 1:1, 3:4, 9:16, 21:9, default 16:9.
21:916:94:31:13:49:16generate_audiobooleanOptionalDefault: trueWhether to generate dialogue, sound effects, and ambient sound synchronized with the visuals, boolean, default true; when disabled, outputs a silent video and does not affect pricing.
callbackobjectOptional
Terminal-state notification config. When omitted, no callback is delivered — poll the task yourself. See the callback note below.
Provide callback.url when creating a task and HiAPI POSTs to your service once the task reaches a terminal state — no polling needed. The callback payload mirrors the task detail structure; signature verification, delivery retries and idempotency are documented on the Unified Async API overview page.
urlstringRequiredRequired when callback is present. A POST is sent to this URL once the task reaches a terminal state; must be a valid http(s) URL.
whenstringOptionalDefault: "final"Only final is supported today — notified on both success and fail.
finalstoragestringOptionalDefault: "temp"Artifact storage tier: temp (default, retained about 7 days) or persistent (long-term, billed by size). Insufficient balance or exceeding the storage cap silently downgrades to temp; the effective tier is shown in the task detail response.
temppersistentRequest examples
# Submit an async task; returns a taskId immediately (no waiting for generation)
curl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "magi-2/text-to-video",
"input": {
"prompt": "…",
"duration": 5,
"aspect_ratio": "16:9",
"generate_audio": true
}
}' const res = await fetch("https://api.hiapi.ai/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "magi-2/text-to-video",
input: {
"prompt": "…",
"duration": 5,
"aspect_ratio": "16:9",
"generate_audio": true
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.ai/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "magi-2/text-to-video",
"input": {
"prompt": "…",
"duration": 5,
"aspect_ratio": "16:9",
"generate_audio": True
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} Get task detail
https://api.hiapi.ai/v1/tasks/:id Response fields
taskIdstringRequiredTask ID, always prefixed with tk-hiapi-.
modelstringRequiredResolved full model name. Tasks submitted with the route parameter return base@route (e.g. gpt-image-2/text-to-image@ext); otherwise identical to the name passed at creation.
routestringOptionalPresent only when the task was submitted with an explicit route parameter; echoes the submitted value.
statusstringRequiredTask status.
queued Queued, not started yet.
handling Being processed.
archiving Processing finished, artifacts being prepared.
success Terminal: completed, artifacts available (output returned).
fail Terminal: failed (error returned).
After submission, check status: success and fail are terminal, everything else is non-terminal. Poll every 1–3 seconds until terminal. On success, download artifacts from output[].url and transfer them before expireAt; pass storage: "persistent" at creation time when long-term retention is needed.
creatednumberRequiredTask creation time (Unix seconds).
completednumberRequiredUnix seconds when the task reached a terminal state; fixed to 0 while not terminal.
outputarrayOptional
Present only when status == success. Artifact list — always an array; a single task may return multiple types at once (e.g. video + first_frame).
Array [ object ]
Array items
urlstringRequiredArtifact URL, directly downloadable.
typestringRequiredCurrent possible values: video, image, audio, first_frame, last_frame, thumbnail; more may be added later.
expireAtnumberRequiredUnix seconds until which the artifact remains accessible; download or transfer before it expires.
errorobjectOptional
Present only when status == fail.
codestringRequiredBusiness error code.
messagestringRequiredError description.
Response examples
Success
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} Processing (non-terminal)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} Failed
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
} Articles
View all articles →-
Guide
Getting Started with magi-2: Generate a 4-Second Video with Sound from a Single Prompt
Three steps from prompt to finished video: describe the picture clearly, set the duration, and get a finished video with synchronized sound effects.
-
Tutorial
Hands-on: Turn a portrait poster into a 4-second short video with dialogue
Without changing the composition or redrawing the character, just add a line of motion and dialogue to make the still frame speak.
-
Comparison
How to choose between magi-2, Kling and Seedance: pick a video model by how you start
It is still video generation, but the difference is not in the spec sheet — it is in what starting point you have on hand: a sentence, an image, or a character design.
Related Models
View all models →Same Type
-
Kandinsky 6.0 Pro Sber AI $1.93 /video -
Runway Aleph 2 Runway $0.480 /second -
Wan 2.2 Animate Alibaba $0.043 /second -
HeyGen Avatar V HeyGen $0.150 /second -
HappyHorse 1.0 Alibaba $0.168 /second -
Ray 3.2 Luma $0.214 /video -
Veo 3.1 Lite Google $0.060 /second -
OmniHuman 2.0 ByteDance $0.100 /second -
LTX 2.5 Fast Lightricks $0.043 /second -
Muse Video 1.0 Meta $0.034 /video -
P-Video 2 Pro Avatar Pruna AI $0.029 /second -
Kling 3.0 Kuaishou $0.100 /second