Skip to content
Sign Up Free
MAGI-2

MAGI-2 video API: 1080p text-to-video

Connect to Sand AI MAGI-2 with a BetterToken API Key and choose fields by Model ID and operation to generate 5–30-second 1080p videos with audio.

Generate 5–30-second 1080p videos with audio from text. Choose landscape 16:9 or portrait 9:16.

Prepare your BetterToken API Key. The Base URL is https://bettertoken.ai/v1, with Authorization: Bearer YOUR_API_KEY for authentication. Copy the Model ID exactly, including capitalization.

Every request.json below follows the same workflow: quote, confirm creation, poll and download. A quote does not start generation; creating a task submits a paid request. See current costs in the model plaza.

Models and operations

The table below lists available values. See the subsection below for field defaults and combination constraints.

Model IDOperationDuration (seconds)Output levelAspect ratioAudioMedia roles
magi-2text_to_video5–30, step 11080p16:9, 9:16onNone

Output videos include audio, which is fixed to on. This model does not accept image or video media.

Text-to-video

magi-2

Use this operation when you have only a text description and need a longer 1080p video.

Set model to this subsection’s Model ID and operation to text_to_video. Use only the generation fields listed below.

FieldTypeRequiredAllowed values or rangeDefault
audio.modestringNoonon
duration.modestringNofixedfixed
duration.secondsintegerNo5–30, step 1 s; only for fixed duration5
output.aspect_ratiostringNo16:9, 9:1616:9
output.formatstringNomp4mp4
output.resolutionstringNo1080p1080p
promptstringYesstringNone
watermarkbooleanNofalsefalse

Media requirements

This operation does not accept media.

Combination constraints

  • duration.mode="fixed" requires duration.seconds. Include the number of seconds whenever you explicitly set fixed.

Request example

Save the JSON below as request.json, then follow the shared workflow to quote first and create after confirmation.

{
"model": "magi-2",
"operation": "text_to_video",
"prompt": "A blue ceramic mug on a white table. Slowly move the camera closer in soft daylight.",
"duration": {
"mode": "fixed",
"seconds": 5
},
"output": {
"resolution": "1080p",
"aspect_ratio": "16:9"
}
}

Common 422 errors

422 error codeAction
enum / range / stepAdjust values and increments to match this subsection’s field table.
unsupported_fieldRemove fields absent from this operation’s field table.
requiresAdd seconds as required by this subsection’s combination constraints.

Official resources

When calling BetterToken, use this page’s fields and the corresponding operation in the live model catalog.