Skip to main content
POST
/
api
/
generate-video
curl --request POST \
  --url https://easy-peasy.ai/api/generate-video \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "prompt": "A cat walking on the beach at sunset, cinematic lighting",
  "model": "Veo 3.1 Fast",
  "duration": "5",
  "aspectRatio": "16:9"
}
'
{
  "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"
}

Workflow

Video generation is asynchronous. Here’s the typical flow:
  1. Submit a video generation request using this endpoint
  2. Save the id from the response
  3. Poll the Get Video endpoint every 15–30 seconds until status is completed
  4. Download the video from the url field
Video generation typically takes 1–5 minutes depending on the model, duration, and resolution. A paid plan is required.

Input types

  • Text-to-video — Provide only a prompt (no image field)
  • Image-to-video — Provide both prompt and image URL. Use models with “Image” in the name (e.g., Veo 3.1 Fast Image, Kling 3.0 Pro Image)

Polling example

async function waitForVideo(videoId, apiKey) {
  const maxAttempts = 40; // ~10 minutes max

  for (let i = 0; i < maxAttempts; i++) {
    const response = await fetch(
      `https://easy-peasy.ai/api/get-video?video_id=${videoId}`,
      {
        headers: { 'x-api-key': apiKey },
      }
    );

    const data = await response.json();

    if (data.video.status === 'completed') {
      return data.video.url; // Video URL is ready!
    }

    await new Promise(resolve => setTimeout(resolve, 15000));
  }

  throw new Error('Video generation timeout');
}

Authorizations

x-api-key
string
header
required

API key for authentication. Get yours at https://easy-peasy.ai/settings/api

Headers

x-api-key
string
required

Your API key

Body

application/json
prompt
string
required

Text prompt describing the video to generate.

Example:

"A cat walking on the beach at sunset, cinematic lighting"

image
string<uri>

URL of an image for image-to-video generation. If omitted, text-to-video mode is used.

model
enum<string>
default:Kling 1.0

The video model to use.

Available options:
Veo 3.1 Fast,
Grok Imagine,
Kling 2.6 Pro,
Veo 3.1 Fast Image,
Grok Imagine Image,
Kling 2.6 Pro Image,
Kling 3.0 Pro,
Kling 3.0 Pro Image,
Kling 3.0 Standard,
Kling 3.0 Standard Image,
Seedance 1.5 Pro,
Seedance 1.5 Pro Image,
Kling Motion Control Pro,
Kling Motion Control,
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,
Sora 2,
Sora 2 Pro,
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,
Sora 2 Image,
Sora 2 Pro Image,
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,
Seedance 2.0
duration
string
default:5

Duration of the video in seconds. Available values depend on the model.

Example:

"5"

aspectRatio
enum<string>
default:16:9

Aspect ratio of the video.

Available options:
16:9,
9:16,
1:1,
4:3,
3:4,
21:9,
9:21,
3:2,
2:3
resolution
enum<string>

Video resolution (supported by some models like Veo 3.1).

Available options:
720p,
1080p,
4k
generateAudio
boolean

Whether to generate audio along with the video (supported by some models like Veo 3.1, Kling 3.0).

Response

Video generation started

id
integer

Video ID. Use this to poll for the result with the Get Video endpoint.

prompt
string

The prompt used for generation

image_url
string

Video URL. Empty string while processing.

model
string

The model used for generation

is_video
boolean
created_at
string<date-time>