Skip to content
Dashboard

MiniMax H3

MiniMax H3 is MiniMax's video model. It generates 2K mp4 clips from a text prompt, a starting image, a pair of first and last frames, or reference images, video, and audio. Your use is subject to MiniMax's Terms & Privacy Policies.

Video Genimage-to-videotext-to-videoreference-to-videoVision (Image)
import { experimental_generateVideo as generateVideo } from 'ai';
const result = await generateVideo({
model: 'minimax/minimax-h3',
prompt: 'A serene mountain lake at sunrise.'
});
Read docs

Getting started

Generate videos with MiniMax H3 using the experimental_generateVideo function from AI SDK 6 or later. AI Gateway handles routing and polls until the video is ready.

Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the video generation quickstart.

index.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'minimax/minimax-h3',
prompt: 'A white kitten chases a butterfly across a sunlit garden.',
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);

Top-level parameters

Load the supported top-level parameters: prompt, duration, aspectRatio, and resolution. 2K is the only resolution H3 renders, and the named tier is accepted in place of the {width}x{height} form.

top-level-params.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'minimax/minimax-h3',
prompt: 'A white kitten chases a butterfly across a sunlit garden.',
duration: 5,
aspectRatio: '16:9',
resolution: '2048x2048',
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);
ParameterTypeRequiredDescription
promptstringNoText description of the video to generate.
durationnumberNoVideo length in seconds. 5-15 seconds.
resolutionstringNoResolution ('2048x2048').
aspectRatiostringNoAspect ratio ('21:9', '16:9', '4:3', '1:1', '3:4', '9:16').
prompt.imagestringNoURL of an image to animate as the first frame. Equivalent to a single frameImages entry with frameType: "first_frame".
frameImagesArray<{ image: string; frameType: 'first_frame' | 'last_frame' }>NoFirst and last frames of the clip. A last_frame without a first_frame is dropped with a warning, and only images are accepted.
inputReferencesArray<string | { data: string; mediaType: string }>NoReference images and videos to keep a subject or follow motion. Up to 9 images and 3 videos. Pass videos as { data, mediaType: "video/mp4" } — a URL without a media type is treated as an image.

Input limits

InputFormatsSourcesMax countMax sizeLimits
Imagejpg, jpeg, png, webp, heic, heifurl930 MB≥256px · ≤5760px · aspect 2:5–5:2
Videoh264, h265, mp4url350 MB2-15s · ≥256px · ≤5760px
Audiowav, mp3url15 MB2-15s

Provider options

Pass MiniMax options under providerOptions.minimax. ratio overrides the top-level aspectRatio and is the only way to request adaptive.

Learn more in the AI SDK MiniMax video docs.

provider-options.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'minimax/minimax-h3',
prompt: 'A white kitten chases a butterfly across a sunlit garden.',
duration: 5,
providerOptions: {
minimax: {
ratio: '16:9',
resolution: '2K',
aigcWatermark: false,
pollIntervalMs: 10000,
pollTimeoutMs: 600000,
},
},
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);

Pass MiniMax-specific options under providerOptions.minimax in your generateVideo call.

ParameterTypeRequiredDescription
ratio'adaptive' | '21:9' | '16:9' | '4:3' | '1:1' | '3:4' | '9:16'NoAspect ratio of the generated video. Overrides the top-level aspectRatio, and unlike it can be set to adaptive.
resolution'2K'NoOutput resolution. H3 currently only supports 2K, which is also the default.
referenceAudioUrlsstring[]NoUp to 3 reference audio URLs for reference-to-video. Must be paired with at least one reference image or video, or the audio is dropped with a warning. The only input that accepts mm_file:// handles — pass images and videos as public URLs, data URIs, or binary data.
aigcWatermarkbooleanNoWhether to embed an AIGC watermark in the output. Defaults to false.
pollIntervalMsnumberNoHow often to check task status. Defaults to 10000.
pollTimeoutMsnumberNoMaximum wait time. Defaults to 600000 (10 minutes).

First and last frame

Control the transition by opening on one image and closing on another. The aspect ratio follows the input images, so an explicit aspectRatio is ignored.

first-last-frame.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'minimax/minimax-h3',
prompt: 'The kitten crosses the garden and settles under the bench.',
duration: 5,
frameImages: [
{ image: 'https://example.com/start.jpg', frameType: 'first_frame' },
{ image: 'https://example.com/end.jpg', frameType: 'last_frame' },
],
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);

Reference to video

Keep a subject or follow motion from reference media, and optionally drive it with reference audio. Videos need an explicit media type; audio goes in providerOptions.minimax.referenceAudioUrls and has to accompany at least one image or video.

reference-to-video.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'minimax/minimax-h3',
prompt: 'The same kitten, now padding along a rainy city street at night.',
duration: 5,
inputReferences: [
'https://example.com/kitten.jpg',
{ data: 'https://example.com/motion.mp4', mediaType: 'video/mp4' },
],
providerOptions: {
minimax: {
ratio: 'adaptive',
referenceAudioUrls: ['https://example.com/voice.wav'],
},
},
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);