{
"id": 12345,
"prompt": "A cat walking on the beach at sunset",
"image_url": "",
"model": "Veo 3.1 Fast",
"is_video": true,
"created_at": "2025-01-15T10:30:00.000Z"
}{
"error": "Invalid model selected"
}{
"error": "Invalid API key"
}{
"error": "This model is not available on the Free plan. Try Veo 3.1 or Seedance 2.0 Mini, or upgrade to unlock all models."
}{
"error": "Invalid API key"
}{
"error": "Invalid API key"
}Generate Video
Generate videos from text, first/last frames, or reference media with MiniMax H3 Max, Seedance 2.5, Gemini Omni Flash 1.1, FLUX 3, WAN 3.0, Veo, Kling, and other models. The exact model title is required. See the video model reference for supported settings.
Generation is asynchronous. Save the returned id and poll Get Video with the same account’s API key. Paid plans require sufficient credits; free access is limited to selected variants and settings.
{
"id": 12345,
"prompt": "A cat walking on the beach at sunset",
"image_url": "",
"model": "Veo 3.1 Fast",
"is_video": true,
"created_at": "2025-01-15T10:30:00.000Z"
}{
"error": "Invalid model selected"
}{
"error": "Invalid API key"
}{
"error": "This model is not available on the Free plan. Try Veo 3.1 or Seedance 2.0 Mini, or upgrade to unlock all models."
}{
"error": "Invalid API key"
}{
"error": "Invalid API key"
}Choose a model
The API supports MiniMax H3 Max, MiniMax H3, Seedance 2.5, Gemini Omni Flash 1.1, FLUX 3, WAN 3.0, Grok Imagine 1.5, and other video families. Use the video model reference to choose an exact variant and its supported inputs, durations, and resolutions.model. The MCP generate_video tool defaults to MiniMax H3 Max when you omit it. REST fields use camelCase, such as aspectRatio and referenceVideos; MCP uses aspect_ratio and reference_videos.Create a video
Send one generation request and save its returnedid. Generation runs asynchronously; an accepted request does not mean the video is ready. Most videos take a few minutes, and queues can take longer.
curl --fail-with-body -X POST https://easy-peasy.ai/api/generate-video \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cat walks along a beach at sunset, waves in the background, cinematic lighting",
"model": "MiniMax H3 Max",
"duration": "5",
"aspectRatio": "16:9",
"resolution": "768p"
}'
480p or 768p. MiniMax H3 accepts 4–15 whole seconds and 768p or 2k. Both families generate native audio; generateAudio: false does not disable it. Models with an audio toggle, such as Seedance 2.5, can accept generateAudio: false. Providing reference audio enables audio generation.
duration as a string. Veo 3.1 text variants accept "4s", "6s", or "8s"; their Image and First-Last Frame variants accept only "8s". Veo 3.1 does not accept five seconds. Equivalent strings such as "8" and "8s" are normalized by the API.Animate an image
Select a model with a first-image input and sendimage. Adding an image does not automatically switch a text model to its image variant.
curl --fail-with-body -X POST https://easy-peasy.ai/api/generate-video \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "The subject slowly turns toward the camera in soft morning light",
"model": "MiniMax H3 Max Image",
"image": "https://yourcdn.com/first-frame.png",
"duration": "5",
"aspectRatio": "16:9",
"resolution": "768p"
}'
"tailImage": "https://yourcdn.com/last-frame.png" when you want a last frame and the chosen variant supports it. Check the Input column in the model catalog; model suffixes alone do not identify every input mode.
Use reference media
Reference variants use images to preserve subjects or style. Some also accept videos for motion or editing and audio for voice or sound guidance. This example uses a character image, a motion clip, and a voice clip. Replace the placeholder URLs with your own media. Keep each MiniMax H3 Max reference video and audio clip between 2 and 15 seconds, and each type’s combined duration at or below 15 seconds.curl --fail-with-body -X POST https://easy-peasy.ai/api/generate-video \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "The character walks through the market with the motion from the video and speaks in the supplied voice",
"model": "MiniMax H3 Max Reference",
"referenceImages": [{ "url": "https://yourcdn.com/character.png" }],
"referenceVideos": [{ "url": "https://yourcdn.com/motion.mp4" }],
"referenceAudios": [{ "url": "https://yourcdn.com/voice.mp3" }],
"duration": "5",
"aspectRatio": "16:9",
"resolution": "768p"
}'
- Use
referenceImages,referenceVideos, andreferenceAudiosas arrays of{ "url": "..." }objects. referenceVideois a single-URL alternative. If you supply thereferenceVideosarray, it takes precedence, including when empty.- Do not combine reference videos with
imageortailImage. Audio references require a reference image or a supported reference video; they cannot accompany a first-frameimage. - Limits differ by variant. MiniMax H3 Max Reference supports up to 9 images; Seedance 2.5 Reference supports up to 30. See reference limits for counts, durations, formats, and sizes.
referenceImages[].typeis optional. Kling O1/O3 usescharacter,object, orstyleto assign reference roles; other families use general image references.
Poll for the result
Call Get Video with the returnedid and the same account’s API key every 15–30 seconds. Read video.url when video.status is completed.
The following Node.js 20+ example checks HTTP errors, handles malformed responses, and stops after ten minutes. A local timeout does not cancel the generation; keep the ID so you can check it later.
async function waitForVideo(videoId, apiKey) {
const deadline = Date.now() + 10 * 60 * 1000;
while (Date.now() < deadline) {
const response = await fetch(
`https://easy-peasy.ai/api/get-video?video_id=${encodeURIComponent(videoId)}`,
{
headers: { 'x-api-key': apiKey },
signal: AbortSignal.timeout(Math.max(1, Math.min(30000, deadline - Date.now()))),
}
);
const data = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(`Video ${videoId}: HTTP ${response.status}: ${data?.error || 'Could not retrieve video'}`);
}
if (data?.video?.status === 'completed' && data.video.url) {
return data.video.url;
}
if (data?.video?.status !== 'processing') {
throw new Error(`Unexpected response for video ${videoId}`);
}
await new Promise(resolve => setTimeout(resolve, Math.max(0, Math.min(15000, deadline - Date.now()))));
}
throw new Error(`Timed out waiting for video ${videoId}. Keep this ID and check it later.`);
}
Handle errors and access limits
| Response | What to do |
|---|---|
400 | Check the exact model name, string duration, resolution, input mode, and reference limits. |
401 | Check your API key and account access. |
403 | Check your plan and remaining credits. Free accounts have specific model and resolution limits. |
404 from Get Video | Verify the ID and account. Missing or deleted jobs, including some failed generations, return 404. |
500 or a network timeout | Save any ID already received. Check the existing job before deciding whether to submit again. |
processing and completed, so do not wait for a failed status. Submitting a new generation can create another billable job; a polling timeout is not a reason to recreate it automatically.Authorizations
API key for authentication. Get yours at https://easy-peasy.ai/settings/api
Body
Text prompt describing the video to generate.
1"A cat walking on the beach at sunset, cinematic lighting"
Required exact model title. See the video model reference for input modes, durations, resolutions, and reference limits. Adding media does not automatically switch model variants. https://docs.easy-peasy.ai/api-reference/video-models
Veo 3.1 Fast, Gemini Omni Flash, Gemini Omni Flash Reference, Gemini Omni Flash 1.1, Gemini Omni Flash 1.1 Reference, MiniMax H3 Max, MiniMax H3 Max Reference, Grok Imagine, Grok Imagine Reference, Grok Imagine 1.5 Text, Grok Imagine 1.5 Reference, Seedance 2.0 Fast, MiniMax H3, Seedance 2.5, Seedance 2.5 Turbo, Seedance 2.5 Turbo Reference, Seedance 2.5 Reference, FLUX 3, WAN 3.0, WAN 3.0 Reference, Seedance 2.0 Turbo, Seedance 2.0, Seedance 2.0 Mini, Seedance 2.0 Reference, Seedance 2.0 Fast Reference, MiniMax H3 Reference, Seedance 2.0 Mini Reference, Kling 2.6 Pro, Veo 3.1 Lite, Veo 3.1 Lite Image, Veo 3.1 Fast Image, Gemini Omni Flash Image, Gemini Omni Flash 1.1 Image, Gemini Omni Flash 1.1 First-Last Frame, MiniMax H3 Max Image, Grok Imagine Image, Grok Imagine 1.5, Seedance 2.0 Image, Seedance 2.0 Fast Image, MiniMax H3 Image, Seedance 2.5 Turbo Image, Seedance 2.5 Image, FLUX 3 Image, WAN 3.0 Image, Seedance 2.0 Turbo Image, Seedance 2.0 Mini Image, Happy Horse, Happy Horse Image, Happy Horse Reference, Kling 2.6 Pro Image, Kling 3.0 Pro, Kling 3.0 Pro Image, Kling 3.0 Standard, Kling 3.0 Standard Image, Kling O3 Pro, Kling O3 Pro Image, Kling O3 Standard, Kling O3 Standard Image, Kling O3 Reference, Seedance 1.5 Pro, Seedance 1.5 Pro Image, Kling O1 Image, Kling O1 Reference, Kling 2.5 Turbo Pro Image, Kling 2.5 Turbo Pro, Kling 2.5 Turbo Standard, Seedance 1.5 Pro First-Last Frame, Veo 3.1, LTX-2 Pro, LTX-2 Fast, Veo 3.1 Image, Veo 3.1 First-Last Frame, Veo 3.1 Fast First-Last Frame, LTX-2 Pro Image, LTX-2 Fast Image, Hailuo 2.0, Hailuo 2.0 Pro, Hailuo 2.3, Hailuo 2.3 Pro, Hailuo 2.3 Image, Hailuo 2.3 Pro Image, Hailuo 2.3-Fast Pro Image, Seedance v1 Pro Fast, Pixverse v5.5, Wan 2.5, Wan v2.2 Turbo, Wan v2.2, Hailuo 2.0 Image, Hailuo 2.0 Pro Image, Seedance 1.0 Pro Fast, Pixverse v5.5 Image, Wan 2.5 Image, Wan v2.2 Turbo Image, Wan-2.2 Image "MiniMax H3 Max"
Public URL of a first-frame image. Choose a variant with a first-image input in the video model reference. Model suffixes are not always enough: Grok Imagine 1.5 and Kling 2.5 Turbo Standard also require image. The URL must remain downloadable without browser cookies through queue delays.
Output length as a string, using the exact variant’s allowed durations. MiniMax H3 Max: 5–15 whole seconds; MiniMax H3: 4–15. Veo 3.1 text variants: 4s, 6s, 8s; Image and First-Last Frame variants: 8s only. Bare seconds and an s suffix are equivalent. If omitted, the API selects five seconds when listed, otherwise the first configured duration, or five seconds for models without a list. Provider-specific output lengths can differ.
"5"
Use an aspect ratio listed for the exact variant. Omit for variants whose framing follows the input. The API defaults to 16:9 when applicable.
16:9, 9:16, 1:1, 4:3, 3:4, 21:9, 3:2, 2:3 Allowed resolutions depend on the exact variant. MiniMax H3 Max: 480p/768p; MiniMax H3: 768p/2k; Seedance 2.5: 480p/720p; Seedance 2.5 Turbo: 720p/1080p. Send a listed value explicitly; defaults vary by model. Use lowercase k for 2k and 4k. Omit when no resolution selector is listed.
360p, 480p, 720p, 768p, 1080p, 2k, 4k Enable or disable generated audio only on models with an audio toggle. MiniMax H3 and H3 Max always generate native audio; false does not disable it. Supplying reference audio enables audio generation. Audio settings can affect credit usage.
Public URL of a last-frame image, paired with image. Use only a variant that supports a last image, such as MiniMax H3 Max Image or Seedance 2.5 Image. See the video model reference.
Array of reference images on supported variants. Reference models require at least one reference image or a supported reference video. Limits differ: MiniMax H3 Max Reference accepts up to 9 images; Seedance 2.5 Reference accepts up to 30. Some Veo variants also support optional references. See the video model reference.
Show child attributes
Show child attributes
Single reference video URL, on variants supporting reference video. Alternative to referenceVideos; the array takes precedence when supplied, even if empty.
Reference videos for supported variants only. Do not combine with image or tailImage. Counts, clip lengths, total duration, and file-size limits depend on the variant. MiniMax H3 Max Reference accepts up to 3 clips of 2–15 seconds, at most 15 seconds combined, and 20 MiB each. Seedance 2.5 Reference supports up to 3 clips of 2–30 seconds, at most 30 seconds combined, and 50 MiB each. Reference inputs can add credit charges.
Show child attributes
Show child attributes
Audio references for supported variants. Require a companion reference image or supported reference video, and cannot accompany image. Enable generated audio. MiniMax H3 Max Reference accepts up to 3 clips of 2–15 seconds and at most 15 seconds total. Seedance 2.5 Reference supports up to 10 MP3/WAV clips, 2–30 seconds each, at most 30 seconds total, and 15 MiB each. See the reference limits for other variants.
Show child attributes
Show child attributes
Response
Video generation started
Video ID. Use this to poll for the result with the Get Video endpoint.
The prompt used for generation
Video URL when present. May be empty or omitted while processing. Poll Get Video with id; do not depend on this field to detect submission success.
The model used for generation
Was this page helpful?
